From 9e7635d5c17c9f06052df959e8904d345a6a7567 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 12 Jul 2024 05:06:38 +0800 Subject: [PATCH] improve doco for R4/R4B renderers --- .../fhir/convertors/wrapper/ResourceWrapperR4.java | 14 ++++++++++++-- .../convertors/wrapper/ResourceWrapperR4B.java | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4.java index fcb295067..a59ea0b89 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4.java @@ -15,8 +15,18 @@ import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.XhtmlNode; /** - * This class is used to walk through the resources when rendering, whether - * the resource is a native resource or loaded by the element model + * An R4 wrapper for the R5 rendering framework - use this to feed R4 resources directly + * into the R5 framework. + * + * The R5 framework is fine to render R4 resources, and has R4 (etc) specific code where + * appropriate (or will be modified to do so). + * + * Note that in order to use this, you need an R5 IWorkerContext. You can create a + * R5 SimpleWorkerContext and load it with all the definitions from R4 (that's how the + * validator works internally, so this is well tested code). But you only need to set + * up the R5 context once; then you can create instances of these to wrap the objects you + * want rendered on the fly. (is thread safe) + * */ public class ResourceWrapperR4 extends ResourceWrapper { diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4B.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4B.java index a6f474f4c..df1179bfa 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4B.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/wrapper/ResourceWrapperR4B.java @@ -15,8 +15,18 @@ import org.hl7.fhir.utilities.xhtml.NodeType; import org.hl7.fhir.utilities.xhtml.XhtmlNode; /** - * This class is used to walk through the resources when rendering, whether - * the resource is a native resource or loaded by the element model + * An R4 wrapper for the R5 rendering framework - use this to feed R4 resources directly + * into the R5 framework. + * + * The R5 framework is fine to render R4 resources, and has R4 (etc) specific code where + * appropriate (or will be modified to do so). + * + * Note that in order to use this, you need an R5 IWorkerContext. You can create a + * R5 SimpleWorkerContext and load it with all the definitions from R4 (that's how the + * validator works internally, so this is well tested code). But you only need to set + * up the R5 context once; then you can create instances of these to wrap the objects you + * want rendered on the fly. (is thread safe) + * */ public class ResourceWrapperR4B extends ResourceWrapper {