From be895cbbac30b6e567b4fb7a6e2bf18ebf2df8de Mon Sep 17 00:00:00 2001 From: raleigh-g-thompson Date: Thu, 13 Nov 2025 11:31:39 -0500 Subject: [PATCH 1/6] adds convert r5 to r4 operation --- .../cqf/tooling/operation/ConvertR5toR4.java | 199 ++++++++++++++++++ .../operations/convert/ConvertR5toR4.java | 126 +++++++++++ 2 files changed, 325 insertions(+) create mode 100644 tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java create mode 100644 tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java new file mode 100644 index 000000000..55ad81644 --- /dev/null +++ b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java @@ -0,0 +1,199 @@ +package org.opencds.cqf.tooling.operation; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; +import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50; +import org.hl7.fhir.instance.model.api.IBaseBundle; +import org.hl7.fhir.instance.model.api.IBaseResource; + +import org.opencds.cqf.tooling.Operation; +import org.opencds.cqf.tooling.utilities.BundleUtils; +import org.opencds.cqf.tooling.utilities.FhirContextCache; +import org.opencds.cqf.tooling.utilities.IOUtils; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.valueset.BundleTypeEnum; +import ca.uhn.fhir.util.BundleBuilder; +import jakarta.annotation.Nonnull; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + + +public class ConvertR5toR4 extends Operation { + + public enum AllowedBundleType { + COLLECTION(BundleTypeEnum.COLLECTION), + TRANSACTION(BundleTypeEnum.TRANSACTION); + + private final BundleTypeEnum reference; + AllowedBundleType(BundleTypeEnum reference) { + this.reference = reference; + } + + + } + + public static Boolean isBundleTypeAllowed(String bundleType) { + return Arrays.stream(AllowedBundleType.values()) + .anyMatch(e -> e.name().equalsIgnoreCase(bundleType)); + } + + public static List allowedBundleTypes() { + return Arrays.stream(AllowedBundleType.values()) + .map(Enum::name) + .map(String::toLowerCase) + .collect(Collectors.toList()); + } + + private static final Logger logger = LoggerFactory.getLogger(ConvertR5toR4.class); + // COMMAND LINE ARGUMENTS - REQUIRED + private String pathToDirectory; // -pathtodir (-ptd) + + // COMMAND LINE ARGUMENTS - OPTIONAL + private String encoding = "json"; // -encoding (-e) + private String bundleId = UUID.randomUUID().toString(); // -bundleid (-bid) + private String bundleType = "collection"; // -type (-t) + private String outputFileName = null; // -outputfilename (-ofn) + + private void extractOptionsFromArgs(String[] args) { + for (String arg : args) { + if (arg.equals("-ConvertR5toR4")) continue; + String[] flagAndValue = arg.split("="); + if (flagAndValue.length < 2) { + throw new IllegalArgumentException("Invalid argument: " + arg); + } + String flag = flagAndValue[0]; + String value = flagAndValue[1]; + + switch (flag.replace("-", "").toLowerCase()) { + case "bundleid": + case "bid": + bundleId = value; + break; + case "bundletype": + case "bt": + bundleType = value; + break; + case "encoding": + case "e": + encoding = value.toLowerCase(); + break; + case "outputfilename": + case "ofn": + outputFileName = value; + break; + case "outputpath": + case "op": + setOutputPath(value); + break; + case "pathtodir": + case "ptd": + pathToDirectory = value; + break; + default: throw new IllegalArgumentException("Unknown flag: " + flag); + } + } + } + + private void validateBundleType() { + if (bundleType == null) { + throw new IllegalArgumentException("BundleType cannot be null"); + } + + if (!isBundleTypeAllowed(bundleType)) { + throw new IllegalArgumentException(String.format("The bundle type [%s] is invalid. Allowed Types: %s", bundleType, String.join(", ",allowedBundleTypes()))); + } + } + + private void validateEncoding() { + if (encoding == null || encoding.isEmpty()) { + encoding = "json"; + } else { + if (!encoding.equalsIgnoreCase("xml") && !encoding.equalsIgnoreCase("json")) { + throw new IllegalArgumentException(String.format("Unsupported encoding: %s. Allowed encodings { json, xml }", encoding)); + } + } + } + + private void validatePathToDirectory() { + if (pathToDirectory == null) { + throw new IllegalArgumentException(String.format("The path [%s] to the resource directory is required", pathToDirectory)); + } + + File resourceDirectory = new File(pathToDirectory); + if (!resourceDirectory.isDirectory()) { + throw new RuntimeException(String.format("The specified path [%s] to resource files is not a directory", pathToDirectory)); + } + + File[] resources = resourceDirectory.listFiles(); + if (resources == null) { + throw new RuntimeException(String.format("The specified path [%s] to resource files is empty", pathToDirectory)); + } + } + + + @Override + public void execute(String[] args) { + setOutputPath("src/main/resources/org/opencds/cqf/tooling/convert/output"); // default + + extractOptionsFromArgs(args); + validateEncoding(); + validatePathToDirectory(); + validateBundleType(); + + BundleTypeEnum bundleType = BundleUtils.getBundleType(this.bundleType); + if (bundleType == null) { + logger.error("Invalid bundle type: {}", this.bundleType); + } + else { + IBaseBundle bundle = convertResources( + bundleId, + bundleType, + IOUtils.readResources( + IOUtils.getFilePaths(pathToDirectory, true), + FhirContextCache.getContext("r5"))); + + IOUtils.writeResource( + bundle, + getOutputPath() == null ? pathToDirectory : getOutputPath(), + IOUtils.Encoding.parse(encoding), + FhirContextCache.getContext("r4"), + true, + outputFileName != null ? outputFileName : bundleId); + } + } + + private IBaseBundle convertResources(String bundleId, BundleTypeEnum type, + @Nonnull List resourcesToConvert) { + VersionConvertor_40_50 versionConverter4050 = new VersionConvertor_40_50(new BaseAdvisor_40_50(true)); + + List convertedResources = new ArrayList<>(); + for (IBaseResource resource: resourcesToConvert){ + if (resource instanceof org.hl7.fhir.r5.model.Resource) { + convertedResources.add(versionConverter4050.convertResource((org.hl7.fhir.r5.model.Resource)resource)); + } + } + + FhirContext context = FhirContextCache.getContext("r4"); + BundleBuilder builder = new BundleBuilder(context); + if (type == BundleTypeEnum.COLLECTION) { + builder.setType(type.getCode()); + convertedResources.forEach(builder::addCollectionEntry); + } + else { + builder.setType("transaction"); + convertedResources.forEach(builder::addTransactionUpdateEntry); + } + IBaseBundle bundle = builder.getBundle(); + bundle.setId(bundleId == null ? UUID.randomUUID().toString() : bundleId); + return bundle; + } +} diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java b/tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java new file mode 100644 index 000000000..b9262e138 --- /dev/null +++ b/tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java @@ -0,0 +1,126 @@ +package org.opencds.cqf.tooling.operations.convert; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; +import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50; +import org.hl7.fhir.instance.model.api.IBaseBundle; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.opencds.cqf.tooling.operations.ExecutableOperation; +import org.opencds.cqf.tooling.operations.Operation; +import org.opencds.cqf.tooling.operations.OperationParam; +import org.opencds.cqf.tooling.utilities.BundleUtils; +import org.opencds.cqf.tooling.utilities.FhirContextCache; +import org.opencds.cqf.tooling.utilities.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.valueset.BundleTypeEnum; +import ca.uhn.fhir.util.BundleBuilder; +import jakarta.annotation.Nonnull; + +@Operation(name = "ConvertR5toR4") +public class ConvertR5toR4 implements ExecutableOperation { + + private static final Logger logger = LoggerFactory.getLogger(ConvertR5toR4.class); + @OperationParam(alias = { "ptr", "pathtoresources" }, setter = "setPathToResources", required = true, + description = "Path to the directory containing the resource files to be consolidated into the new bundle (required)") + private String pathToResources; + @OperationParam(alias = { "e", "encoding" }, setter = "setEncoding", defaultValue = "json", + description = "The file format to be used for representing the resulting Bundle { json, xml } (default json)") + private String encoding; + @OperationParam(alias = { "t", "type" }, setter = "setType", defaultValue = "transaction", + description = "The Bundle type as defined in the FHIR specification for the Bundle.type element (default transaction)") + private String type; + @OperationParam(alias = { "bid", "bundleid" }, setter = "setBundleId", + description = "A valid FHIR ID to be used as the ID for the resulting FHIR Bundle (optional)") + private String bundleId; + @OperationParam(alias = { "op", "outputPath" }, setter = "setOutputPath", + defaultValue = "src/main/resources/org/opencds/cqf/tooling/convertR5toR4/output", + description = "The directory path to which the generated Bundle file should be written (default src/main/resources/org/opencds/cqf/tooling/convertR5toR4/output)") + private String outputPath; + + @Override + public void execute() { + FhirContext context = FhirContextCache.getContext("r5"); + BundleTypeEnum bundleType = BundleUtils.getBundleType(type); + if (bundleType == null) { + logger.error("Invalid bundle type: {}", type); + } + else { + IBaseBundle bundle = convertResources(context, bundleId, bundleType, + IOUtils.readResources(IOUtils.getFilePaths(pathToResources, true), context)); + IOUtils.writeResource(bundle, outputPath == null ? pathToResources : outputPath, + IOUtils.Encoding.parse(encoding), context); + } + } + + public static IBaseBundle convertResources(@Nonnull FhirContext fhirContext, + String bundleId, BundleTypeEnum type, + @Nonnull List resourcesToConvert) { + VersionConvertor_40_50 versionConverter4050 = new VersionConvertor_40_50(new BaseAdvisor_40_50(true)); + + List convertedResources = new ArrayList<>(); + for (IBaseResource resource: resourcesToConvert){ + if (resource instanceof org.hl7.fhir.r5.model.Resource) { + convertedResources.add(versionConverter4050.convertResource((org.hl7.fhir.r5.model.Resource)resourcesToConvert)); + } + } + + BundleBuilder builder = new BundleBuilder(fhirContext); + if (type == BundleTypeEnum.COLLECTION) { + builder.setType(type.getCode()); + convertedResources.forEach(builder::addCollectionEntry); + } + else { + builder.setType("transaction"); + convertedResources.forEach(builder::addTransactionUpdateEntry); + } + IBaseBundle bundle = builder.getBundle(); + bundle.setId(bundleId == null ? UUID.randomUUID().toString() : bundleId); + return bundle; + } + + public String getPathToResources() { + return pathToResources; + } + + public void setPathToResources(String pathToResources) { + this.pathToResources = pathToResources; + } + + public String getEncoding() { + return encoding; + } + + public void setEncoding(String encoding) { + this.encoding = encoding; + } + + public String getBundleId() { + return bundleId; + } + + public void setBundleId(String bundleId) { + this.bundleId = bundleId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getOutputPath() { + return outputPath; + } + + public void setOutputPath(String outputDirectory) { + this.outputPath = outputDirectory; + } +} From eeb735455971ffee071abd3272a529b8f94d5b73 Mon Sep 17 00:00:00 2001 From: raleigh-g-thompson Date: Thu, 13 Nov 2025 15:31:02 -0500 Subject: [PATCH 2/6] adds r5 to r4 operation tests --- .../tooling/operation/ConvertR5toR4Test.java | 118 ++++++++++++++++++ ...on-ImplantableDeviceStatusObservation.json | 1 + ...finition-ManufacturingDateObservation.json | 1 + .../StructureDefinition-NotesSection.json | 1 + ...reDefinition-ProcedureFindingsSection.json | 1 + ...uctureDefinition-SocialHistorySection.json | 1 + .../r5-code-system-action-code.json | 1 + .../r5-concept-map-observation-status.json | 1 + .../r5-structured-definition-code.json | 1 + .../valueset/r5-valueset-event-status.json | 1 + 10 files changed, 127 insertions(+) create mode 100644 tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ImplantableDeviceStatusObservation.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ManufacturingDateObservation.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-NotesSection.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ProcedureFindingsSection.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-SocialHistorySection.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system/r5-code-system-action-code.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/concept-map/r5-concept-map-observation-status.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/structured-definition/r5-structured-definition-code.json create mode 100644 tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/valueset/r5-valueset-event-status.json diff --git a/tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java b/tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java new file mode 100644 index 000000000..113e87db8 --- /dev/null +++ b/tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java @@ -0,0 +1,118 @@ +package org.opencds.cqf.tooling.operation; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Stream; + +public class ConvertR5toR4Test { + + private final String ENCODING_ARGUMENT = "-e="; + private final String OUTPUT_FILENAME_ARGUMENT = "-ofn="; + private final String OUTPUT_PATH_ARGUMENT = "-op="; + private final String PATH_TO_DIRECTORY_ARGUMENT = "-ptd="; + private final String TYPE_ARGUMENT = "-t="; + + private static String GetFullPath(String relativePath) { + return System.getProperty("user.dir") + File.separator + relativePath; + } + + private void ClearDirectory(String directoryPath){ + try (Stream stream = Files.walk(Paths.get(directoryPath))) { + stream.filter(Files::isRegularFile) // Filter for regular files only + .forEach(file -> { + try { + Files.delete(file); + } catch (IOException e) { + System.err.println("Failed to delete file: " + file + " - " + e.getMessage()); + } + }); + } catch (IOException e) { + System.err.println("Error walking directory: " + e.getMessage()); + } + } + + private void ConvertSingleResource(String sourceDirectory, String outputPath, String outputFile) { + String[] args = new String[5]; + args[0] = "-ConvertR5toR4"; + args[1] = PATH_TO_DIRECTORY_ARGUMENT + sourceDirectory; + args[2] = ENCODING_ARGUMENT+ "json"; + args[3] = OUTPUT_PATH_ARGUMENT + outputPath; + args[4] = OUTPUT_FILENAME_ARGUMENT + outputFile; + + ClearDirectory(outputPath); + ConvertR5toR4 converter = new ConvertR5toR4(); + converter.execute(args); + + File resultDir = new File(outputPath); + File[] actualFiles = resultDir.listFiles((dir, name) -> name.endsWith(".json")); + Assert.assertNotNull(actualFiles, "Conversion folder should not be null."); + Assert.assertEquals(actualFiles.length,1, "Conversion folder should only have a single file."); + } + + private void ConvertMulitpleResources(String sourceDirectory, String outputPath) { + String[] args = new String[4]; + args[0] = "-ConvertR5toR4"; + args[1] = PATH_TO_DIRECTORY_ARGUMENT + sourceDirectory; + args[2] = ENCODING_ARGUMENT+ "json"; + args[3] = OUTPUT_PATH_ARGUMENT + outputPath; + + ClearDirectory(outputPath); + ConvertR5toR4 converter = new ConvertR5toR4(); + converter.execute(args); + + File resultDir = new File(outputPath); + File[] actualFiles = resultDir.listFiles((dir, name) -> name.endsWith(".json")); + Assert.assertNotNull(actualFiles, "Conversion folder should not be null."); + //Assert.assertEquals(actualFiles.length,1, "Conversion folder should only have a single file."); + } + + @Test + public void testExecute_ConvertSingleResourceCodeSystem() { + ConvertSingleResource( + GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system"), + GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/code-system"), + "r4-code-system-action-code" + ); + } + + @Test + public void testExecute_ConvertSingleResourceConceptMap() { + ConvertSingleResource( + GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/concept-map"), + GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/concept-map"), + "r4-concept-map-observation-status" + ); + } + + @Test + public void testExecute_ConvertSingleResourceStructuredDefinition() { + ConvertSingleResource( + GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/structured-definition"), + GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/structured-definition"), + "r4-structured-definition-code" + ); + } + + @Test + public void testExecute_ConvertSingleResourceValueset() { + ConvertSingleResource( + GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/valueset"), + GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/valueset"), + "r4-valueset-event-status" + ); + } + + @Test + public void testExecute_ConvertMultipleResources() { + ConvertMulitpleResources( + GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources"), + GetFullPath("target/test-output/convertR5toR4SingleResourceResults/multiple-resources") + ); + } +} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ImplantableDeviceStatusObservation.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ImplantableDeviceStatusObservation.json new file mode 100644 index 000000000..e40b00926 --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ImplantableDeviceStatusObservation.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"ImplantableDeviceStatusObservation","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition ImplantableDeviceStatusObservation

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Observation C1..1ObservationXML Namespace: urn:hl7-org:v3
Elements defined in Ancestors:@nullFlavor, realmCode, typeId, templateId, @classCode, @moodCode, @negationInd, id, sdtcCategory, code, derivationExpr, text, statusCode, effectiveTime, priorityCode, repeatNumber, languageCode, value, interpretationCode, methodCode, targetSiteCode, subject, specimen, performer, author, informant, participant, entryRelationship, reference, precondition, sdtcPrecondition2, referenceRange, sdtcInFulfillmentOf1
Base for all types and resources
Instance of this type are validated by templateId
Logical Container: ClinicalDocument (CDA Class)
Constraints: should-text-ref-value
\".\"\".\"\".\" Slices for templateId 1..*IISlice: Unordered, Open by value:root, value:extension
\".\"\".\"\".\"\".\" templateId:implant-device-status-obs 1..1II
\".\"\".\"\".\"\".\"\".\" @root 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.10.20.22.4.305
\".\"\".\"\".\"\".\"\".\" @extension 1..1stRequired Pattern: 2019-06-21
\".\"\".\"\".\" code 1..1CDCode for "Implantable Device Status"
\".\"\".\"\".\"\".\" @code 1..1csRequired Pattern: C160939
\".\"\".\"\".\"\".\" @codeSystem 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.3.26.1.1
\".\"\".\"\".\"\".\" @codeSystemName 0..1stMAY be set to 'NCI Thesaurus'
\".\"\".\"\".\"\".\" @displayName 0..1stMAY be set to 'Implantable Device Status'
\".\"\".\"\".\" text 0..1EDSHOULD reference the portion of section narrative text corresponding to this entry
\".\"\".\"\".\"\".\" reference C0..1TELConstraints: value-starts-octothorpe
\".\"\".\"\".\" value 1..1CD
\".\"\".\"\".\"\".\" @nullFlavor 0..0
\".\"\".\"\".\"\".\" @code 1..1csBinding: Implantable Device Status \".\"/ (required)

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-target","_valueBoolean":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/data-absent-reason","valueCode":"not-applicable"}]}},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:v3"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"observation"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-container","valueUri":"http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/type-profile-style","valueCode":"cda"}],"url":"http://hl7.org/cda/us/ccda/StructureDefinition/ImplantableDeviceStatusObservation","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:hl7ii:2.16.840.1.113883.10.20.22.4.305:2019-06-21"}],"version":"4.0.0","name":"ImplantableDeviceStatusObservation","title":"Implantable Device Status Observation","status":"draft","date":"2025-06-20T08:22:30+08:00","publisher":"Health Level Seven","contact":[{"name":"HL7 International - Structured Documents","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/structure"}]}],"description":"This template is intended to be used in addition to the Product Instance template to augment the parsed data from the a Unique Device Identifier (UDI). This template is used to exchange the status of the patient's implantable medical device. This status is only relevant to medical devices implanted in the patient's body.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US"}]}],"fhirVersion":"5.0.0","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"logical","abstract":false,"type":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","baseDefinition":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"2.0.1-sd"}],"element":[{"id":"Observation","path":"Observation","short":"Base for all types and resources","definition":"Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.","min":1,"max":"1","base":{"path":"Base","min":0,"max":"*"},"constraint":[{"key":"should-text-ref-value","severity":"warning","human":"SHOULD contain text/reference/@value","expression":"text.reference.value.exists()","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ImplantableDeviceStatusObservation"}],"isModifier":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.nullFlavor","path":"Observation.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.realmCode","path":"Observation.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Observation.typeId","path":"Observation.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Observation.typeId.nullFlavor","path":"Observation.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.typeId.assigningAuthorityName","path":"Observation.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.typeId.displayable","path":"Observation.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.typeId.root","path":"Observation.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Observation.typeId.extension","path":"Observation.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.templateId","path":"Observation.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.templateId:implant-device-status-obs","path":"Observation.templateId","sliceName":"implant-device-status-obs","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"1","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.templateId:implant-device-status-obs.nullFlavor","path":"Observation.templateId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.templateId:implant-device-status-obs.assigningAuthorityName","path":"Observation.templateId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.templateId:implant-device-status-obs.displayable","path":"Observation.templateId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.templateId:implant-device-status-obs.root","path":"Observation.templateId.root","representation":["xmlAttr"],"label":"Root","definition":"A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.10.20.22.4.305"},{"id":"Observation.templateId:implant-device-status-obs.extension","path":"Observation.templateId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}],"patternString":"2019-06-21"},{"id":"Observation.classCode","path":"Observation.classCode","representation":["xmlAttr"],"min":1,"max":"1","base":{"path":"Observation.classCode","min":1,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAActClassObservation"}},{"id":"Observation.moodCode","path":"Observation.moodCode","representation":["xmlAttr"],"min":1,"max":"1","base":{"path":"Observation.moodCode","min":1,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActMoodDocumentObservation|2.0.0"}},{"id":"Observation.negationInd","path":"Observation.negationInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Observation.negationInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.id","path":"Observation.id","min":0,"max":"*","base":{"path":"Observation.id","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.sdtcCategory","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"category"}],"path":"Observation.sdtcCategory","min":0,"max":"*","base":{"path":"Observation.sdtcCategory","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.code","path":"Observation.code","representation":["typeAttr"],"short":"Code for \"Implantable Device Status\"","comment":"SHALL contain exactly one [1..1] code (CONF:4437-3503).","min":1,"max":"1","base":{"path":"Observation.code","min":1,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-ObservationType"}},{"id":"Observation.code.nullFlavor","path":"Observation.code.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.code.code","path":"Observation.code.code","representation":["xmlAttr"],"label":"Code","definition":"The plain code symbol defined by the code system. For example, \"784.0\" is the code symbol of the ICD-9 code \"784.0\" for headache.","comment":"This code SHALL contain exactly one [1..1] @code=\"C160939\" Implantable Device Status (CodeSystem: NCI Thesaurus (NCIt) urn:oid:2.16.840.1.113883.3.26.1.1 STATIC) (CONF:4437-3507).","min":1,"max":"1","base":{"path":"CD.code","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"patternCode":"C160939"},{"id":"Observation.code.codeSystem","path":"Observation.code.codeSystem","representation":["xmlAttr"],"label":"Code System","definition":"Specifies the code system that defines the code.","comment":"This code SHALL contain exactly one [1..1] @codeSystem=\"2.16.840.1.113883.3.26.1.1\" (CONF:4437-3508).","min":1,"max":"1","base":{"path":"CD.codeSystem","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.3.26.1.1"},{"id":"Observation.code.codeSystemName","path":"Observation.code.codeSystemName","representation":["xmlAttr"],"label":"Code System Name","short":"MAY be set to 'NCI Thesaurus'","definition":"The common name of the coding system.","comment":"This code MAY contain zero or one [0..1] @codeSystemName=\"NCI Thesaurus\" (CONF:4437-3509).","min":0,"max":"1","base":{"path":"CD.codeSystemName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.codeSystemVersion","path":"Observation.code.codeSystemVersion","representation":["xmlAttr"],"label":"Code System Version","definition":"If applicable, a version descriptor defined specifically for the given code system.","min":0,"max":"1","base":{"path":"CD.codeSystemVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.displayName","path":"Observation.code.displayName","representation":["xmlAttr"],"label":"Display Name","short":"MAY be set to 'Implantable Device Status'","definition":"A name or title for the code, under which the sending system shows the code value to its users.","comment":"This code MAY contain zero or one [0..1] @displayName=\"Implantable Device Status\" (CONF:4437-3510).","min":0,"max":"1","base":{"path":"CD.displayName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.sdtcValueSet","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSet"}],"path":"Observation.code.sdtcValueSet","representation":["xmlAttr"],"definition":"The valueSet extension adds an attribute for elements with a CD dataType which indicates the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.valueSet","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid"]}]},{"id":"Observation.code.sdtcValueSetVersion","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSetVersion"}],"path":"Observation.code.sdtcValueSetVersion","representation":["xmlAttr"],"definition":"The valueSetVersion extension adds an attribute for elements with a CD dataType which indicates the version of the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.sdtcValueSetVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.originalText","path":"Observation.code.originalText","label":"Original Text","definition":"The text or phrase used as the basis for the coding.","min":0,"max":"1","base":{"path":"CD.originalText","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Observation.code.qualifier","path":"Observation.code.qualifier","label":"Qualifier","definition":"Specifies additional codes that increase the specificity of the the primary code.","min":0,"max":"*","base":{"path":"CD.qualifier","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CR"}]},{"id":"Observation.code.translation","path":"Observation.code.translation","representation":["typeAttr"],"label":"Translation","definition":"A set of other concept descriptors that translate this concept descriptor into other code systems.","min":0,"max":"*","base":{"path":"CD.translation","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.derivationExpr","path":"Observation.derivationExpr","min":0,"max":"1","base":{"path":"Observation.derivationExpr","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ST"}]},{"id":"Observation.text","path":"Observation.text","representation":["typeAttr"],"short":"SHOULD reference the portion of section narrative text corresponding to this entry","min":0,"max":"1","base":{"path":"Observation.text","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Observation.text.nullFlavor","path":"Observation.text.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.text.compression","path":"Observation.text.compression","representation":["xmlAttr"],"label":"Compression","definition":"Indicates whether the raw byte data is compressed, and what compression algorithm was used.","min":0,"max":"1","base":{"path":"ED.compression","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDACompressionAlgorithm"}},{"id":"Observation.text.integrityCheck","path":"Observation.text.integrityCheck","representation":["xmlAttr"],"label":"Integrity Check","definition":"The integrity check is a short binary value representing a cryptographically strong checksum that is calculated over the binary data. The purpose of this property, when communicated with a reference is for anyone to validate later whether the reference still resolved to the same data that the reference resolved to when the encapsulated data value with reference was created.","min":0,"max":"1","base":{"path":"ED.integrityCheck","min":0,"max":"1"},"type":[{"code":"base64Binary","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bin"]}]},{"id":"Observation.text.integrityCheckAlgorithm","path":"Observation.text.integrityCheckAlgorithm","representation":["xmlAttr"],"label":"Integrity Check Algorithm","definition":"Specifies the algorithm used to compute the integrityCheck value. The cryptographically strong checksum algorithm Secure Hash Algorithm-1 (SHA-1) is currently the industry standard. It has superseded the MD5 algorithm only a couple of years ago, when certain flaws in the security of MD5 were discovered. Currently the SHA-1 hash algorithm is the default choice for the integrity check algorithm. Note that SHA-256 is also entering widespread usage.","min":0,"max":"1","base":{"path":"ED.integrityCheckAlgorithm","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-IntegrityCheckAlgorithm|2.0.0"}},{"id":"Observation.text.language","path":"Observation.text.language","representation":["xmlAttr"],"label":"Language","definition":"For character based information the language property specifies the human language of the text.","min":0,"max":"1","base":{"path":"ED.language","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}]},{"id":"Observation.text.mediaType","path":"Observation.text.mediaType","representation":["xmlAttr"],"label":"Media Type","definition":"Identifies the type of the encapsulated data and identifies a method to interpret or render the data.","min":0,"max":"1","base":{"path":"ED.mediaType","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-MediaType"}},{"id":"Observation.text.representation","path":"Observation.text.representation","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"ED.representation","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/BinaryDataEncoding"}},{"id":"Observation.text.xmlText","path":"Observation.text.xmlText","representation":["xmlText"],"short":"Allows for mixed text content. If @representation='B64', this SHALL be a base64binary string.","definition":"Data that is primarily intended for human interpretation or for further machine processing is outside the scope of HL7. This includes unformatted or formatted written language, multimedia data, or structured information as defined by a different standard (e.g., XML-signatures.)","comment":"This element is represented in XML as textual content. The actual name \"xmlText\" will not appear in a CDA instance.","min":0,"max":"1","base":{"path":"ED.xmlText","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.text.reference","path":"Observation.text.reference","label":"Reference","definition":"A telecommunication address (TEL), such as a URL for HTTP or FTP, which will resolve to precisely the same binary data that could as well have been provided as inline data.","min":0,"max":"1","base":{"path":"ED.reference","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/TEL"}],"constraint":[{"key":"value-starts-octothorpe","severity":"error","human":"If reference/@value is present, it SHALL begin with a '#' and SHALL point to its corresponding narrative","expression":"value.exists() implies value.startsWith('#')","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ImplantableDeviceStatusObservation"}]},{"id":"Observation.text.thumbnail","path":"Observation.text.thumbnail","label":"Thumbnail","definition":"An abbreviated rendition of the full data. A thumbnail requires significantly fewer resources than the full data, while still maintaining some distinctive similarity with the full data. A thumbnail is typically used with by-reference encapsulated data. It allows a user to select data more efficiently before actually downloading through the reference.","min":0,"max":"1","base":{"path":"ED.thumbnail","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Observation.statusCode","path":"Observation.statusCode","min":0,"max":"1","base":{"path":"Observation.statusCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}],"binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActStatus"}},{"id":"Observation.effectiveTime","path":"Observation.effectiveTime","min":0,"max":"1","base":{"path":"Observation.effectiveTime","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/IVL-TS"}]},{"id":"Observation.priorityCode","path":"Observation.priorityCode","min":0,"max":"1","base":{"path":"Observation.priorityCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActPriority"}},{"id":"Observation.repeatNumber","path":"Observation.repeatNumber","min":0,"max":"1","base":{"path":"Observation.repeatNumber","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/IVL-INT"}]},{"id":"Observation.languageCode","path":"Observation.languageCode","min":0,"max":"1","base":{"path":"Observation.languageCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}],"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/all-languages"}},{"id":"Observation.value","path":"Observation.value","representation":["typeAttr"],"comment":"SHALL contain exactly one [1..1] value with @xsi:type=\"CD\", where the code SHALL be selected from ValueSet Implantable Device Status urn:oid:2.16.840.1.113762.1.4.1021.48 STATIC 2019-06-21 (CONF:4437-3504).","min":1,"max":"1","base":{"path":"Observation.value","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.value.nullFlavor","path":"Observation.value.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"0","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.value.code","path":"Observation.value.code","representation":["xmlAttr"],"label":"Code","definition":"The plain code symbol defined by the code system. For example, \"784.0\" is the code symbol of the ICD-9 code \"784.0\" for headache.","min":1,"max":"1","base":{"path":"CD.code","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.48"}},{"id":"Observation.value.codeSystem","path":"Observation.value.codeSystem","representation":["xmlAttr"],"label":"Code System","definition":"Specifies the code system that defines the code.","min":0,"max":"1","base":{"path":"CD.codeSystem","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}]},{"id":"Observation.value.codeSystemName","path":"Observation.value.codeSystemName","representation":["xmlAttr"],"label":"Code System Name","definition":"The common name of the coding system.","min":0,"max":"1","base":{"path":"CD.codeSystemName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.value.codeSystemVersion","path":"Observation.value.codeSystemVersion","representation":["xmlAttr"],"label":"Code System Version","definition":"If applicable, a version descriptor defined specifically for the given code system.","min":0,"max":"1","base":{"path":"CD.codeSystemVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.value.displayName","path":"Observation.value.displayName","representation":["xmlAttr"],"label":"Display Name","definition":"A name or title for the code, under which the sending system shows the code value to its users.","min":0,"max":"1","base":{"path":"CD.displayName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.value.sdtcValueSet","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSet"}],"path":"Observation.value.sdtcValueSet","representation":["xmlAttr"],"definition":"The valueSet extension adds an attribute for elements with a CD dataType which indicates the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.valueSet","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid"]}]},{"id":"Observation.value.sdtcValueSetVersion","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSetVersion"}],"path":"Observation.value.sdtcValueSetVersion","representation":["xmlAttr"],"definition":"The valueSetVersion extension adds an attribute for elements with a CD dataType which indicates the version of the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.sdtcValueSetVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.value.originalText","path":"Observation.value.originalText","label":"Original Text","definition":"The text or phrase used as the basis for the coding.","min":0,"max":"1","base":{"path":"CD.originalText","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Observation.value.qualifier","path":"Observation.value.qualifier","label":"Qualifier","definition":"Specifies additional codes that increase the specificity of the the primary code.","min":0,"max":"*","base":{"path":"CD.qualifier","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CR"}]},{"id":"Observation.value.translation","path":"Observation.value.translation","representation":["typeAttr"],"label":"Translation","definition":"A set of other concept descriptors that translate this concept descriptor into other code systems.","min":0,"max":"*","base":{"path":"CD.translation","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.interpretationCode","path":"Observation.interpretationCode","min":0,"max":"*","base":{"path":"Observation.interpretationCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAObservationInterpretation"}},{"id":"Observation.methodCode","path":"Observation.methodCode","min":0,"max":"*","base":{"path":"Observation.methodCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-ObservationMethod"}},{"id":"Observation.targetSiteCode","path":"Observation.targetSiteCode","definition":"Drawn from concept domain ActSite","min":0,"max":"*","base":{"path":"Observation.targetSiteCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.subject","path":"Observation.subject","min":0,"max":"1","base":{"path":"Observation.subject","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Subject"}]},{"id":"Observation.specimen","path":"Observation.specimen","min":0,"max":"*","base":{"path":"Observation.specimen","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Specimen"}]},{"id":"Observation.performer","path":"Observation.performer","min":0,"max":"*","base":{"path":"Observation.performer","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Performer2"}]},{"id":"Observation.author","path":"Observation.author","min":0,"max":"*","base":{"path":"Observation.author","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Author"}]},{"id":"Observation.informant","path":"Observation.informant","min":0,"max":"*","base":{"path":"Observation.informant","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Informant"}]},{"id":"Observation.participant","path":"Observation.participant","min":0,"max":"*","base":{"path":"Observation.participant","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Participant2"}]},{"id":"Observation.entryRelationship","path":"Observation.entryRelationship","min":0,"max":"*","base":{"path":"Observation.entryRelationship","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/EntryRelationship"}]},{"id":"Observation.reference","path":"Observation.reference","min":0,"max":"*","base":{"path":"Observation.reference","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Reference"}]},{"id":"Observation.precondition","path":"Observation.precondition","min":0,"max":"*","base":{"path":"Observation.precondition","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Precondition"}]},{"id":"Observation.sdtcPrecondition2","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"precondition2"}],"path":"Observation.sdtcPrecondition2","min":0,"max":"*","base":{"path":"Observation.sdtcPrecondition2","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Precondition2"}]},{"id":"Observation.referenceRange","path":"Observation.referenceRange","definition":"Relates an Observation to the ObservationRange class, where the expected range of values for a particular observation can be specified.","min":0,"max":"*","base":{"path":"Observation.referenceRange","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Observation.referenceRange.nullFlavor","path":"Observation.referenceRange.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.referenceRange.realmCode","path":"Observation.referenceRange.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Observation.referenceRange.typeId","path":"Observation.referenceRange.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/Observation"}]},{"id":"Observation.referenceRange.typeId.nullFlavor","path":"Observation.referenceRange.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.referenceRange.typeId.assigningAuthorityName","path":"Observation.referenceRange.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.referenceRange.typeId.displayable","path":"Observation.referenceRange.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.referenceRange.typeId.root","path":"Observation.referenceRange.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Observation.referenceRange.typeId.extension","path":"Observation.referenceRange.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.referenceRange.templateId","path":"Observation.referenceRange.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.referenceRange.typeCode","path":"Observation.referenceRange.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Observation.referenceRange.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"REFV","binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAActRelationshipType"}},{"id":"Observation.referenceRange.observationRange","path":"Observation.referenceRange.observationRange","min":1,"max":"1","base":{"path":"Observation.referenceRange.observationRange","min":1,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationRange"}]},{"id":"Observation.sdtcInFulfillmentOf1","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"inFulfillmentOf1"}],"path":"Observation.sdtcInFulfillmentOf1","min":0,"max":"*","base":{"path":"Observation.sdtcInFulfillmentOf1","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/InFulfillmentOf1"}]}]},"differential":{"element":[{"id":"Observation","path":"Observation","constraint":[{"key":"should-text-ref-value","severity":"warning","human":"SHOULD contain text/reference/@value","expression":"text.reference.value.exists()","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ImplantableDeviceStatusObservation"}]},{"id":"Observation.templateId","path":"Observation.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"min":1},{"id":"Observation.templateId:implant-device-status-obs","path":"Observation.templateId","sliceName":"implant-device-status-obs","min":1,"max":"1"},{"id":"Observation.templateId:implant-device-status-obs.root","path":"Observation.templateId.root","min":1,"patternString":"2.16.840.1.113883.10.20.22.4.305"},{"id":"Observation.templateId:implant-device-status-obs.extension","path":"Observation.templateId.extension","min":1,"patternString":"2019-06-21"},{"id":"Observation.code","path":"Observation.code","short":"Code for \"Implantable Device Status\"","comment":"SHALL contain exactly one [1..1] code (CONF:4437-3503)."},{"id":"Observation.code.code","path":"Observation.code.code","comment":"This code SHALL contain exactly one [1..1] @code=\"C160939\" Implantable Device Status (CodeSystem: NCI Thesaurus (NCIt) urn:oid:2.16.840.1.113883.3.26.1.1 STATIC) (CONF:4437-3507).","min":1,"patternCode":"C160939"},{"id":"Observation.code.codeSystem","path":"Observation.code.codeSystem","comment":"This code SHALL contain exactly one [1..1] @codeSystem=\"2.16.840.1.113883.3.26.1.1\" (CONF:4437-3508).","min":1,"patternString":"2.16.840.1.113883.3.26.1.1"},{"id":"Observation.code.codeSystemName","path":"Observation.code.codeSystemName","short":"MAY be set to 'NCI Thesaurus'","comment":"This code MAY contain zero or one [0..1] @codeSystemName=\"NCI Thesaurus\" (CONF:4437-3509)."},{"id":"Observation.code.displayName","path":"Observation.code.displayName","short":"MAY be set to 'Implantable Device Status'","comment":"This code MAY contain zero or one [0..1] @displayName=\"Implantable Device Status\" (CONF:4437-3510)."},{"id":"Observation.text","path":"Observation.text","short":"SHOULD reference the portion of section narrative text corresponding to this entry"},{"id":"Observation.text.reference","path":"Observation.text.reference","constraint":[{"key":"value-starts-octothorpe","severity":"error","human":"If reference/@value is present, it SHALL begin with a '#' and SHALL point to its corresponding narrative","expression":"value.exists() implies value.startsWith('#')","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ImplantableDeviceStatusObservation"}]},{"id":"Observation.value","path":"Observation.value","comment":"SHALL contain exactly one [1..1] value with @xsi:type=\"CD\", where the code SHALL be selected from ValueSet Implantable Device Status urn:oid:2.16.840.1.113762.1.4.1021.48 STATIC 2019-06-21 (CONF:4437-3504).","min":1,"max":"1","type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.value.nullFlavor","path":"Observation.value.nullFlavor","max":"0"},{"id":"Observation.value.code","path":"Observation.value.code","min":1,"binding":{"strength":"required","valueSet":"http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1021.48"}}]}} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ManufacturingDateObservation.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ManufacturingDateObservation.json new file mode 100644 index 000000000..d1f878449 --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ManufacturingDateObservation.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"ManufacturingDateObservation","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition ManufacturingDateObservation

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Observation C1..1ObservationXML Namespace: urn:hl7-org:v3
Elements defined in Ancestors:@nullFlavor, realmCode, typeId, templateId, @classCode, @moodCode, @negationInd, id, sdtcCategory, code, derivationExpr, text, statusCode, effectiveTime, priorityCode, repeatNumber, languageCode, value, interpretationCode, methodCode, targetSiteCode, subject, specimen, performer, author, informant, participant, entryRelationship, reference, precondition, sdtcPrecondition2, referenceRange, sdtcInFulfillmentOf1
Base for all types and resources
Instance of this type are validated by templateId
Logical Container: ClinicalDocument (CDA Class)
Constraints: should-text-ref-value
\".\"\".\"\".\" Slices for templateId 1..*IISlice: Unordered, Open by value:root, value:extension
\".\"\".\"\".\"\".\" templateId:manufact-date-obs 1..1II
\".\"\".\"\".\"\".\"\".\" @root 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.10.20.22.4.316
\".\"\".\"\".\"\".\"\".\" @extension 1..1stRequired Pattern: 2019-06-21
\".\"\".\"\".\" code 1..1CDCode for "Manufacturing Date"
\".\"\".\"\".\"\".\" @code 1..1csManufacturing Date code
Required Pattern: C101669
\".\"\".\"\".\"\".\" @codeSystem 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.3.26.1.1
\".\"\".\"\".\"\".\" @codeSystemName 0..1stMAY be set to 'NCI Thesaurus'
\".\"\".\"\".\"\".\" @displayName 0..1stMAY be set to 'Manufacturing Date'
\".\"\".\"\".\" text 0..1EDSHOULD reference the portion of section narrative text corresponding to this entry
\".\"\".\"\".\"\".\" reference C0..1TELConstraints: value-starts-octothorpe
\".\"\".\"\".\" value 1..1TSManufacturing Date as a time stamp
\".\"\".\"\".\"\".\" @value 1..1ts

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-target","_valueBoolean":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/data-absent-reason","valueCode":"not-applicable"}]}},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:v3"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"observation"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-container","valueUri":"http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/type-profile-style","valueCode":"cda"}],"url":"http://hl7.org/cda/us/ccda/StructureDefinition/ManufacturingDateObservation","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:hl7ii:2.16.840.1.113883.10.20.22.4.316:2019-06-21"}],"version":"4.0.0","name":"ManufacturingDateObservation","title":"Manufacturing Date Observation","status":"draft","date":"2025-06-20T08:22:30+08:00","publisher":"Health Level Seven","contact":[{"name":"HL7 International - Structured Documents","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/structure"}]}],"description":"This template is intended to be used in addition to the Product Instance template to exchange the Manufacturing Date of the device. The manufacturing date is parsed from the UDI value, if present.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US"}]}],"fhirVersion":"5.0.0","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"logical","abstract":false,"type":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","baseDefinition":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"2.0.1-sd"}],"element":[{"id":"Observation","path":"Observation","short":"Base for all types and resources","definition":"Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.","min":1,"max":"1","base":{"path":"Base","min":0,"max":"*"},"constraint":[{"key":"should-text-ref-value","severity":"warning","human":"SHOULD contain text/reference/@value","expression":"text.reference.value.exists()","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ManufacturingDateObservation"}],"isModifier":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.nullFlavor","path":"Observation.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.realmCode","path":"Observation.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Observation.typeId","path":"Observation.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Observation.typeId.nullFlavor","path":"Observation.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.typeId.assigningAuthorityName","path":"Observation.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.typeId.displayable","path":"Observation.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.typeId.root","path":"Observation.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Observation.typeId.extension","path":"Observation.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.templateId","path":"Observation.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.templateId:manufact-date-obs","path":"Observation.templateId","sliceName":"manufact-date-obs","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"1","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.templateId:manufact-date-obs.nullFlavor","path":"Observation.templateId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.templateId:manufact-date-obs.assigningAuthorityName","path":"Observation.templateId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.templateId:manufact-date-obs.displayable","path":"Observation.templateId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.templateId:manufact-date-obs.root","path":"Observation.templateId.root","representation":["xmlAttr"],"label":"Root","definition":"A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.10.20.22.4.316"},{"id":"Observation.templateId:manufact-date-obs.extension","path":"Observation.templateId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}],"patternString":"2019-06-21"},{"id":"Observation.classCode","path":"Observation.classCode","representation":["xmlAttr"],"min":1,"max":"1","base":{"path":"Observation.classCode","min":1,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAActClassObservation"}},{"id":"Observation.moodCode","path":"Observation.moodCode","representation":["xmlAttr"],"min":1,"max":"1","base":{"path":"Observation.moodCode","min":1,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActMoodDocumentObservation|2.0.0"}},{"id":"Observation.negationInd","path":"Observation.negationInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Observation.negationInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.id","path":"Observation.id","min":0,"max":"*","base":{"path":"Observation.id","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.sdtcCategory","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"category"}],"path":"Observation.sdtcCategory","min":0,"max":"*","base":{"path":"Observation.sdtcCategory","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.code","path":"Observation.code","representation":["typeAttr"],"short":"Code for \"Manufacturing Date\"","comment":"SHALL contain exactly one [1..1] code (CONF:4437-3460).","min":1,"max":"1","base":{"path":"Observation.code","min":1,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-ObservationType"}},{"id":"Observation.code.nullFlavor","path":"Observation.code.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.code.code","path":"Observation.code.code","representation":["xmlAttr"],"label":"Code","short":"Manufacturing Date code","definition":"The plain code symbol defined by the code system. For example, \"784.0\" is the code symbol of the ICD-9 code \"784.0\" for headache.","comment":"This code SHALL contain exactly one [1..1] @code=\"C101669\" Manufacturing Date (CodeSystem: NCI Thesaurus (NCIt) urn:oid:2.16.840.1.113883.3.26.1.1 STATIC) (CONF:4437-3464).","min":1,"max":"1","base":{"path":"CD.code","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"patternCode":"C101669"},{"id":"Observation.code.codeSystem","path":"Observation.code.codeSystem","representation":["xmlAttr"],"label":"Code System","definition":"Specifies the code system that defines the code.","comment":"This code SHALL contain exactly one [1..1] @codeSystem=\"2.16.840.1.113883.3.26.1.1\" (CONF:4437-3465).","min":1,"max":"1","base":{"path":"CD.codeSystem","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.3.26.1.1"},{"id":"Observation.code.codeSystemName","path":"Observation.code.codeSystemName","representation":["xmlAttr"],"label":"Code System Name","short":"MAY be set to 'NCI Thesaurus'","definition":"The common name of the coding system.","comment":"This code MAY contain zero or one [0..1] @codeSystemName=\"NCI Thesaurus\" (CONF:4437-3466).","min":0,"max":"1","base":{"path":"CD.codeSystemName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.codeSystemVersion","path":"Observation.code.codeSystemVersion","representation":["xmlAttr"],"label":"Code System Version","definition":"If applicable, a version descriptor defined specifically for the given code system.","min":0,"max":"1","base":{"path":"CD.codeSystemVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.displayName","path":"Observation.code.displayName","representation":["xmlAttr"],"label":"Display Name","short":"MAY be set to 'Manufacturing Date'","definition":"A name or title for the code, under which the sending system shows the code value to its users.","comment":"This code MAY contain zero or one [0..1] @displayName=\"Manufacturing Date\" (CONF:4437-3467).","min":0,"max":"1","base":{"path":"CD.displayName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.sdtcValueSet","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSet"}],"path":"Observation.code.sdtcValueSet","representation":["xmlAttr"],"definition":"The valueSet extension adds an attribute for elements with a CD dataType which indicates the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.valueSet","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid"]}]},{"id":"Observation.code.sdtcValueSetVersion","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSetVersion"}],"path":"Observation.code.sdtcValueSetVersion","representation":["xmlAttr"],"definition":"The valueSetVersion extension adds an attribute for elements with a CD dataType which indicates the version of the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.sdtcValueSetVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.code.originalText","path":"Observation.code.originalText","label":"Original Text","definition":"The text or phrase used as the basis for the coding.","min":0,"max":"1","base":{"path":"CD.originalText","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Observation.code.qualifier","path":"Observation.code.qualifier","label":"Qualifier","definition":"Specifies additional codes that increase the specificity of the the primary code.","min":0,"max":"*","base":{"path":"CD.qualifier","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CR"}]},{"id":"Observation.code.translation","path":"Observation.code.translation","representation":["typeAttr"],"label":"Translation","definition":"A set of other concept descriptors that translate this concept descriptor into other code systems.","min":0,"max":"*","base":{"path":"CD.translation","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.derivationExpr","path":"Observation.derivationExpr","min":0,"max":"1","base":{"path":"Observation.derivationExpr","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ST"}]},{"id":"Observation.text","path":"Observation.text","representation":["typeAttr"],"short":"SHOULD reference the portion of section narrative text corresponding to this entry","min":0,"max":"1","base":{"path":"Observation.text","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Observation.text.nullFlavor","path":"Observation.text.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.text.compression","path":"Observation.text.compression","representation":["xmlAttr"],"label":"Compression","definition":"Indicates whether the raw byte data is compressed, and what compression algorithm was used.","min":0,"max":"1","base":{"path":"ED.compression","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDACompressionAlgorithm"}},{"id":"Observation.text.integrityCheck","path":"Observation.text.integrityCheck","representation":["xmlAttr"],"label":"Integrity Check","definition":"The integrity check is a short binary value representing a cryptographically strong checksum that is calculated over the binary data. The purpose of this property, when communicated with a reference is for anyone to validate later whether the reference still resolved to the same data that the reference resolved to when the encapsulated data value with reference was created.","min":0,"max":"1","base":{"path":"ED.integrityCheck","min":0,"max":"1"},"type":[{"code":"base64Binary","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bin"]}]},{"id":"Observation.text.integrityCheckAlgorithm","path":"Observation.text.integrityCheckAlgorithm","representation":["xmlAttr"],"label":"Integrity Check Algorithm","definition":"Specifies the algorithm used to compute the integrityCheck value. The cryptographically strong checksum algorithm Secure Hash Algorithm-1 (SHA-1) is currently the industry standard. It has superseded the MD5 algorithm only a couple of years ago, when certain flaws in the security of MD5 were discovered. Currently the SHA-1 hash algorithm is the default choice for the integrity check algorithm. Note that SHA-256 is also entering widespread usage.","min":0,"max":"1","base":{"path":"ED.integrityCheckAlgorithm","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-IntegrityCheckAlgorithm|2.0.0"}},{"id":"Observation.text.language","path":"Observation.text.language","representation":["xmlAttr"],"label":"Language","definition":"For character based information the language property specifies the human language of the text.","min":0,"max":"1","base":{"path":"ED.language","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}]},{"id":"Observation.text.mediaType","path":"Observation.text.mediaType","representation":["xmlAttr"],"label":"Media Type","definition":"Identifies the type of the encapsulated data and identifies a method to interpret or render the data.","min":0,"max":"1","base":{"path":"ED.mediaType","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-MediaType"}},{"id":"Observation.text.representation","path":"Observation.text.representation","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"ED.representation","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/BinaryDataEncoding"}},{"id":"Observation.text.xmlText","path":"Observation.text.xmlText","representation":["xmlText"],"short":"Allows for mixed text content. If @representation='B64', this SHALL be a base64binary string.","definition":"Data that is primarily intended for human interpretation or for further machine processing is outside the scope of HL7. This includes unformatted or formatted written language, multimedia data, or structured information as defined by a different standard (e.g., XML-signatures.)","comment":"This element is represented in XML as textual content. The actual name \"xmlText\" will not appear in a CDA instance.","min":0,"max":"1","base":{"path":"ED.xmlText","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.text.reference","path":"Observation.text.reference","label":"Reference","definition":"A telecommunication address (TEL), such as a URL for HTTP or FTP, which will resolve to precisely the same binary data that could as well have been provided as inline data.","min":0,"max":"1","base":{"path":"ED.reference","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/TEL"}],"constraint":[{"key":"value-starts-octothorpe","severity":"error","human":"If reference/@value is present, it SHALL begin with a '#' and SHALL point to its corresponding narrative","expression":"value.exists() implies value.startsWith('#')","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ManufacturingDateObservation"}]},{"id":"Observation.text.thumbnail","path":"Observation.text.thumbnail","label":"Thumbnail","definition":"An abbreviated rendition of the full data. A thumbnail requires significantly fewer resources than the full data, while still maintaining some distinctive similarity with the full data. A thumbnail is typically used with by-reference encapsulated data. It allows a user to select data more efficiently before actually downloading through the reference.","min":0,"max":"1","base":{"path":"ED.thumbnail","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Observation.statusCode","path":"Observation.statusCode","min":0,"max":"1","base":{"path":"Observation.statusCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}],"binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActStatus"}},{"id":"Observation.effectiveTime","path":"Observation.effectiveTime","min":0,"max":"1","base":{"path":"Observation.effectiveTime","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/IVL-TS"}]},{"id":"Observation.priorityCode","path":"Observation.priorityCode","min":0,"max":"1","base":{"path":"Observation.priorityCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActPriority"}},{"id":"Observation.repeatNumber","path":"Observation.repeatNumber","min":0,"max":"1","base":{"path":"Observation.repeatNumber","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/IVL-INT"}]},{"id":"Observation.languageCode","path":"Observation.languageCode","min":0,"max":"1","base":{"path":"Observation.languageCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}],"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/all-languages"}},{"id":"Observation.value","path":"Observation.value","representation":["typeAttr"],"short":"Manufacturing Date as a time stamp","comment":"SHALL contain exactly one [1..1] value with @xsi:type=\"TS\" (CONF:4437-3461).","min":1,"max":"1","base":{"path":"Observation.value","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/TS"}]},{"id":"Observation.value.nullFlavor","path":"Observation.value.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.value.value","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-date-format","valueString":"YYYYMMDDHHMMSS.UUUU[+|-ZZzz]"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-date-rules","valueString":"year-valid"}],"path":"Observation.value.value","representation":["xmlAttr"],"definition":"A quantity specifying a point on the axis of natural time. A point in time is most often represented as a calendar expression.","comment":"This value SHALL contain exactly one [1..1] @value (CONF:4437-3468).","min":1,"max":"1","base":{"path":"TS.value","min":0,"max":"1"},"type":[{"code":"dateTime","profile":["http://hl7.org/cda/stds/core/StructureDefinition/ts-simple"]}]},{"id":"Observation.interpretationCode","path":"Observation.interpretationCode","min":0,"max":"*","base":{"path":"Observation.interpretationCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAObservationInterpretation"}},{"id":"Observation.methodCode","path":"Observation.methodCode","min":0,"max":"*","base":{"path":"Observation.methodCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}],"binding":{"strength":"example","valueSet":"http://terminology.hl7.org/ValueSet/v3-ObservationMethod"}},{"id":"Observation.targetSiteCode","path":"Observation.targetSiteCode","definition":"Drawn from concept domain ActSite","min":0,"max":"*","base":{"path":"Observation.targetSiteCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Observation.subject","path":"Observation.subject","min":0,"max":"1","base":{"path":"Observation.subject","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Subject"}]},{"id":"Observation.specimen","path":"Observation.specimen","min":0,"max":"*","base":{"path":"Observation.specimen","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Specimen"}]},{"id":"Observation.performer","path":"Observation.performer","min":0,"max":"*","base":{"path":"Observation.performer","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Performer2"}]},{"id":"Observation.author","path":"Observation.author","min":0,"max":"*","base":{"path":"Observation.author","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Author"}]},{"id":"Observation.informant","path":"Observation.informant","min":0,"max":"*","base":{"path":"Observation.informant","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Informant"}]},{"id":"Observation.participant","path":"Observation.participant","min":0,"max":"*","base":{"path":"Observation.participant","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Participant2"}]},{"id":"Observation.entryRelationship","path":"Observation.entryRelationship","min":0,"max":"*","base":{"path":"Observation.entryRelationship","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/EntryRelationship"}]},{"id":"Observation.reference","path":"Observation.reference","min":0,"max":"*","base":{"path":"Observation.reference","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Reference"}]},{"id":"Observation.precondition","path":"Observation.precondition","min":0,"max":"*","base":{"path":"Observation.precondition","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Precondition"}]},{"id":"Observation.sdtcPrecondition2","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"precondition2"}],"path":"Observation.sdtcPrecondition2","min":0,"max":"*","base":{"path":"Observation.sdtcPrecondition2","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Precondition2"}]},{"id":"Observation.referenceRange","path":"Observation.referenceRange","definition":"Relates an Observation to the ObservationRange class, where the expected range of values for a particular observation can be specified.","min":0,"max":"*","base":{"path":"Observation.referenceRange","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Observation.referenceRange.nullFlavor","path":"Observation.referenceRange.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.referenceRange.realmCode","path":"Observation.referenceRange.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Observation.referenceRange.typeId","path":"Observation.referenceRange.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/Observation"}]},{"id":"Observation.referenceRange.typeId.nullFlavor","path":"Observation.referenceRange.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Observation.referenceRange.typeId.assigningAuthorityName","path":"Observation.referenceRange.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.referenceRange.typeId.displayable","path":"Observation.referenceRange.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Observation.referenceRange.typeId.root","path":"Observation.referenceRange.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Observation.referenceRange.typeId.extension","path":"Observation.referenceRange.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Observation.referenceRange.templateId","path":"Observation.referenceRange.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Observation.referenceRange.typeCode","path":"Observation.referenceRange.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Observation.referenceRange.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"REFV","binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAActRelationshipType"}},{"id":"Observation.referenceRange.observationRange","path":"Observation.referenceRange.observationRange","min":1,"max":"1","base":{"path":"Observation.referenceRange.observationRange","min":1,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationRange"}]},{"id":"Observation.sdtcInFulfillmentOf1","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"inFulfillmentOf1"}],"path":"Observation.sdtcInFulfillmentOf1","min":0,"max":"*","base":{"path":"Observation.sdtcInFulfillmentOf1","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/InFulfillmentOf1"}]}]},"differential":{"element":[{"id":"Observation","path":"Observation","constraint":[{"key":"should-text-ref-value","severity":"warning","human":"SHOULD contain text/reference/@value","expression":"text.reference.value.exists()","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ManufacturingDateObservation"}]},{"id":"Observation.templateId","path":"Observation.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"min":1},{"id":"Observation.templateId:manufact-date-obs","path":"Observation.templateId","sliceName":"manufact-date-obs","min":1,"max":"1"},{"id":"Observation.templateId:manufact-date-obs.root","path":"Observation.templateId.root","min":1,"patternString":"2.16.840.1.113883.10.20.22.4.316"},{"id":"Observation.templateId:manufact-date-obs.extension","path":"Observation.templateId.extension","min":1,"patternString":"2019-06-21"},{"id":"Observation.code","path":"Observation.code","short":"Code for \"Manufacturing Date\"","comment":"SHALL contain exactly one [1..1] code (CONF:4437-3460)."},{"id":"Observation.code.code","path":"Observation.code.code","short":"Manufacturing Date code","comment":"This code SHALL contain exactly one [1..1] @code=\"C101669\" Manufacturing Date (CodeSystem: NCI Thesaurus (NCIt) urn:oid:2.16.840.1.113883.3.26.1.1 STATIC) (CONF:4437-3464).","min":1,"patternCode":"C101669"},{"id":"Observation.code.codeSystem","path":"Observation.code.codeSystem","comment":"This code SHALL contain exactly one [1..1] @codeSystem=\"2.16.840.1.113883.3.26.1.1\" (CONF:4437-3465).","min":1,"patternString":"2.16.840.1.113883.3.26.1.1"},{"id":"Observation.code.codeSystemName","path":"Observation.code.codeSystemName","short":"MAY be set to 'NCI Thesaurus'","comment":"This code MAY contain zero or one [0..1] @codeSystemName=\"NCI Thesaurus\" (CONF:4437-3466)."},{"id":"Observation.code.displayName","path":"Observation.code.displayName","short":"MAY be set to 'Manufacturing Date'","comment":"This code MAY contain zero or one [0..1] @displayName=\"Manufacturing Date\" (CONF:4437-3467)."},{"id":"Observation.text","path":"Observation.text","short":"SHOULD reference the portion of section narrative text corresponding to this entry"},{"id":"Observation.text.reference","path":"Observation.text.reference","constraint":[{"key":"value-starts-octothorpe","severity":"error","human":"If reference/@value is present, it SHALL begin with a '#' and SHALL point to its corresponding narrative","expression":"value.exists() implies value.startsWith('#')","source":"http://hl7.org/cda/us/ccda/StructureDefinition/ManufacturingDateObservation"}]},{"id":"Observation.value","path":"Observation.value","short":"Manufacturing Date as a time stamp","comment":"SHALL contain exactly one [1..1] value with @xsi:type=\"TS\" (CONF:4437-3461).","min":1,"max":"1","type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/TS"}]},{"id":"Observation.value.value","path":"Observation.value.value","comment":"This value SHALL contain exactly one [1..1] @value (CONF:4437-3468).","min":1}]}} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-NotesSection.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-NotesSection.json new file mode 100644 index 000000000..35bffeba4 --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-NotesSection.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"NotesSection","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition NotesSection

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Section C1..1SectionXML Namespace: urn:hl7-org:v3
Elements defined in Ancestors:@nullFlavor, realmCode, typeId, templateId, @ID, @classCode, @moodCode, id, code, title, text, confidentialityCode, languageCode, subject, author, informant, entry, component
Base for all types and resources
Instance of this type are validated by templateId
Logical Container: ClinicalDocument (CDA Class)
Constraints: shall-note-activity
\".\"\".\"\".\" Slices for templateId 1..*IISlice: Unordered, Open by value:root, value:extension
\".\"\".\"\".\"\".\" templateId:section 1..1II
\".\"\".\"\".\"\".\"\".\" @root 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.10.20.22.2.65
\".\"\".\"\".\"\".\"\".\" @extension 1..1stRequired Pattern: 2016-11-01
\".\"\".\"\".\" code 1..1CEBinding: Note Types \".\"/ (preferred)
\".\"\".\"\".\"\".\" @code 1..1cs
\".\"\".\"\".\"\".\" @codeSystem 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.6.1
\".\"\".\"\".\" title 1..1STThis title should reflect the kind of notes included in this section, corresponding to the code.
\".\"\".\"\".\" text 1..1xhtmlThe narrative SHOULD contain human-readable representations using standard CDA narrative markup of each note to ensure widest compatibility with receivers.\n\nWhile allowed by CDA, the use of renderMultiMedia elements, which contain a referencedObject attribute pointing to an observationMedia or regionOfInterest element in the discrete entries, is discouraged in Note Sections because rendering support for these elements is not widespread.
\".\"\".\"\".\" Slices for entry 0..*EntrySlice: Unordered, Open by profile:act
\".\"\".\"\".\"\".\" entry:note 0..*EntryIf section/@nullFlavor is not present:
\".\"\".\"\".\"\".\"\".\" act 1..1NoteActivity

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-target","_valueBoolean":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/data-absent-reason","valueCode":"not-applicable"}]}},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:v3"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"section"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-container","valueUri":"http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/type-profile-style","valueCode":"cda"}],"url":"http://hl7.org/cda/us/ccda/StructureDefinition/NotesSection","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:hl7ii:2.16.840.1.113883.10.20.22.2.65:2016-11-01"}],"version":"4.0.0","name":"NotesSection","title":"Notes Section","status":"draft","date":"2025-06-20T08:22:30+08:00","publisher":"Health Level Seven","contact":[{"name":"HL7 International - Structured Documents","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/structure"}]}],"description":"The Notes Section allow for inclusion of clinical documentation which does not fit precisely within any other C-CDA section. Multiple Notes sections may be included in a document provided they each include different types of note content as indicated by a different section.code.\nThe Notes Section SHOULD NOT be used in place of a more specific C-CDA section. For example, notes about procedure should be placed within the Procedures Section, not a Notes Section.\nWhen a Notes Section is present, Note Activity entries contain structured information about the note information allowing it to be more machine processable. \n\n#### Templates Used\nAlthough open templates may contain any valid CDA content, the following templates are specifically called out by this template:\n\n**Required Entries**: [NoteActivity](StructureDefinition-NoteActivity.html)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US"}]}],"fhirVersion":"5.0.0","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"logical","abstract":false,"type":"http://hl7.org/cda/stds/core/StructureDefinition/Section","baseDefinition":"http://hl7.org/cda/stds/core/StructureDefinition/Section","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"2.0.1-sd"}],"element":[{"id":"Section","path":"Section","short":"Base for all types and resources","definition":"Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.","min":1,"max":"1","base":{"path":"Base","min":0,"max":"*"},"constraint":[{"key":"shall-note-activity","severity":"error","human":"If section/@nullFlavor is not present, SHALL contain at least one Note Activity","expression":"nullFlavor.exists() or entry.where(act.hasTemplateIdOf('http://hl7.org/cda/us/ccda/StructureDefinition/NoteActivity')).exists()","source":"http://hl7.org/cda/us/ccda/StructureDefinition/NotesSection"}],"isModifier":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Section.nullFlavor","path":"Section.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.realmCode","path":"Section.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.typeId","path":"Section.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.typeId.nullFlavor","path":"Section.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.typeId.assigningAuthorityName","path":"Section.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.typeId.displayable","path":"Section.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.typeId.root","path":"Section.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.typeId.extension","path":"Section.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.templateId","path":"Section.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.templateId:section","path":"Section.templateId","sliceName":"section","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"1","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.templateId:section.nullFlavor","path":"Section.templateId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.templateId:section.assigningAuthorityName","path":"Section.templateId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.templateId:section.displayable","path":"Section.templateId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.templateId:section.root","path":"Section.templateId.root","representation":["xmlAttr"],"label":"Root","definition":"A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.10.20.22.2.65"},{"id":"Section.templateId:section.extension","path":"Section.templateId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}],"patternString":"2016-11-01"},{"id":"Section.ID","path":"Section.ID","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.ID","min":0,"max":"1"},"type":[{"code":"id","profile":["http://hl7.org/cda/stds/core/StructureDefinition/xs-ID"]}]},{"id":"Section.classCode","path":"Section.classCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.classCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"DOCSECT","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActClassRecordOrganizer"}},{"id":"Section.moodCode","path":"Section.moodCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.moodCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"EVN","binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAActMood"}},{"id":"Section.id","path":"Section.id","min":0,"max":"1","base":{"path":"Section.id","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.code","path":"Section.code","comment":"SHALL contain exactly one [1..1] code, which SHOULD be selected from ValueSet Note Types urn:oid:2.16.840.1.113883.11.20.9.68 DYNAMIC (CONF:3250-16892).","min":1,"max":"1","base":{"path":"Section.code","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}],"binding":{"strength":"preferred","valueSet":"http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.11.20.9.68"}},{"id":"Section.code.nullFlavor","path":"Section.code.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.code.code","path":"Section.code.code","representation":["xmlAttr"],"label":"Code","definition":"The plain code symbol defined by the code system. For example, \"784.0\" is the code symbol of the ICD-9 code \"784.0\" for headache.","min":1,"max":"1","base":{"path":"CD.code","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}]},{"id":"Section.code.codeSystem","path":"Section.code.codeSystem","representation":["xmlAttr"],"label":"Code System","definition":"Specifies the code system that defines the code.","min":1,"max":"1","base":{"path":"CD.codeSystem","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.6.1"},{"id":"Section.code.codeSystemName","path":"Section.code.codeSystemName","representation":["xmlAttr"],"label":"Code System Name","definition":"The common name of the coding system.","min":0,"max":"1","base":{"path":"CD.codeSystemName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.codeSystemVersion","path":"Section.code.codeSystemVersion","representation":["xmlAttr"],"label":"Code System Version","definition":"If applicable, a version descriptor defined specifically for the given code system.","min":0,"max":"1","base":{"path":"CD.codeSystemVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.displayName","path":"Section.code.displayName","representation":["xmlAttr"],"label":"Display Name","definition":"A name or title for the code, under which the sending system shows the code value to its users.","min":0,"max":"1","base":{"path":"CD.displayName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.sdtcValueSet","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSet"}],"path":"Section.code.sdtcValueSet","representation":["xmlAttr"],"definition":"The valueSet extension adds an attribute for elements with a CD dataType which indicates the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.valueSet","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid"]}]},{"id":"Section.code.sdtcValueSetVersion","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSetVersion"}],"path":"Section.code.sdtcValueSetVersion","representation":["xmlAttr"],"definition":"The valueSetVersion extension adds an attribute for elements with a CD dataType which indicates the version of the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.sdtcValueSetVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.originalText","path":"Section.code.originalText","label":"Original Text","definition":"The text or phrase used as the basis for the coding.","min":0,"max":"1","base":{"path":"CD.originalText","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Section.code.qualifier","path":"Section.code.qualifier","label":"Qualifier","definition":"Specifies additional codes that increase the specificity of the the primary code.","min":0,"max":"0","base":{"path":"CD.qualifier","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CR"}]},{"id":"Section.code.translation","path":"Section.code.translation","representation":["typeAttr"],"label":"Translation","definition":"A set of other concept descriptors that translate this concept descriptor into other code systems.","min":0,"max":"*","base":{"path":"CD.translation","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Section.title","path":"Section.title","short":"This title should reflect the kind of notes included in this section, corresponding to the code.","min":1,"max":"1","base":{"path":"Section.title","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ST"}]},{"id":"Section.text","path":"Section.text","representation":["cdaText"],"short":"The narrative SHOULD contain human-readable representations using standard CDA narrative markup of each note to ensure widest compatibility with receivers.\n\nWhile allowed by CDA, the use of renderMultiMedia elements, which contain a referencedObject attribute pointing to an observationMedia or regionOfInterest element in the discrete entries, is discouraged in Note Sections because rendering support for these elements is not widespread.","min":1,"max":"1","base":{"path":"Section.text","min":0,"max":"1"},"type":[{"code":"xhtml"}]},{"id":"Section.confidentialityCode","path":"Section.confidentialityCode","min":0,"max":"1","base":{"path":"Section.confidentialityCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}]},{"id":"Section.languageCode","path":"Section.languageCode","min":0,"max":"1","base":{"path":"Section.languageCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}],"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/all-languages"}},{"id":"Section.subject","path":"Section.subject","min":0,"max":"1","base":{"path":"Section.subject","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Subject"}]},{"id":"Section.author","path":"Section.author","min":0,"max":"*","base":{"path":"Section.author","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Author"}]},{"id":"Section.informant","path":"Section.informant","min":0,"max":"*","base":{"path":"Section.informant","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Informant"}]},{"id":"Section.entry","path":"Section.entry","slicing":{"discriminator":[{"type":"profile","path":"act"}],"rules":"open"},"comment":"SHALL contain at least one [1..*] entry (CONF:3250-16904) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:note","path":"Section.entry","sliceName":"note","short":"If section/@nullFlavor is not present:","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:note.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:note.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:note.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:note.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:note.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:note.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:note.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:note.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:note.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:note.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:note.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:note.act","path":"Section.entry.act","comment":"SHALL contain exactly one [1..1] Note Activity (identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.202:2016-11-01) (CONF:3250-16905).","min":1,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/NoteActivity"]}]},{"id":"Section.entry:note.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:note.observation","path":"Section.entry.observation","min":0,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation"}]},{"id":"Section.entry:note.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:note.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:note.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:note.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:note.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:note.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.component","path":"Section.component","min":0,"max":"*","base":{"path":"Section.component","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.component.nullFlavor","path":"Section.component.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.component.realmCode","path":"Section.component.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.component.typeId","path":"Section.component.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/Section"}]},{"id":"Section.component.typeId.nullFlavor","path":"Section.component.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.component.typeId.assigningAuthorityName","path":"Section.component.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.component.typeId.displayable","path":"Section.component.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.component.typeId.root","path":"Section.component.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.component.typeId.extension","path":"Section.component.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.component.templateId","path":"Section.component.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.component.typeCode","path":"Section.component.typeCode","representation":["xmlAttr"],"definition":"Drawn from concept domain DocumentSectionType","min":0,"max":"1","base":{"path":"Section.component.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"COMP"},{"id":"Section.component.contextConductionInd","path":"Section.component.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.component.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.component.section","path":"Section.component.section","min":1,"max":"1","base":{"path":"Section.component.section","min":1,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Section"}]}]},"differential":{"element":[{"id":"Section","path":"Section","constraint":[{"key":"shall-note-activity","severity":"error","human":"If section/@nullFlavor is not present, SHALL contain at least one Note Activity","expression":"nullFlavor.exists() or entry.where(act.hasTemplateIdOf('http://hl7.org/cda/us/ccda/StructureDefinition/NoteActivity')).exists()","source":"http://hl7.org/cda/us/ccda/StructureDefinition/NotesSection"}]},{"id":"Section.templateId","path":"Section.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"min":1},{"id":"Section.templateId:section","path":"Section.templateId","sliceName":"section","min":1,"max":"1"},{"id":"Section.templateId:section.root","path":"Section.templateId.root","min":1,"patternString":"2.16.840.1.113883.10.20.22.2.65"},{"id":"Section.templateId:section.extension","path":"Section.templateId.extension","min":1,"patternString":"2016-11-01"},{"id":"Section.code","path":"Section.code","comment":"SHALL contain exactly one [1..1] code, which SHOULD be selected from ValueSet Note Types urn:oid:2.16.840.1.113883.11.20.9.68 DYNAMIC (CONF:3250-16892).","min":1,"binding":{"strength":"preferred","valueSet":"http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.11.20.9.68"}},{"id":"Section.code.code","path":"Section.code.code","min":1},{"id":"Section.code.codeSystem","path":"Section.code.codeSystem","min":1,"patternString":"2.16.840.1.113883.6.1"},{"id":"Section.title","path":"Section.title","short":"This title should reflect the kind of notes included in this section, corresponding to the code.","min":1},{"id":"Section.text","path":"Section.text","short":"The narrative SHOULD contain human-readable representations using standard CDA narrative markup of each note to ensure widest compatibility with receivers.\n\nWhile allowed by CDA, the use of renderMultiMedia elements, which contain a referencedObject attribute pointing to an observationMedia or regionOfInterest element in the discrete entries, is discouraged in Note Sections because rendering support for these elements is not widespread.","min":1},{"id":"Section.entry","path":"Section.entry","slicing":{"discriminator":[{"type":"profile","path":"act"}],"rules":"open"},"comment":"SHALL contain at least one [1..*] entry (CONF:3250-16904) such that it"},{"id":"Section.entry:note","path":"Section.entry","sliceName":"note","short":"If section/@nullFlavor is not present:","min":0,"max":"*"},{"id":"Section.entry:note.act","path":"Section.entry.act","comment":"SHALL contain exactly one [1..1] Note Activity (identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.202:2016-11-01) (CONF:3250-16905).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/NoteActivity"]}]}]}} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ProcedureFindingsSection.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ProcedureFindingsSection.json new file mode 100644 index 000000000..6287fb54c --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-ProcedureFindingsSection.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"ProcedureFindingsSection","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition ProcedureFindingsSection

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Section SectionXML Namespace: urn:hl7-org:v3
Elements defined in Ancestors:@nullFlavor, realmCode, typeId, templateId, @ID, @classCode, @moodCode, id, code, title, text, confidentialityCode, languageCode, subject, author, informant, entry, component
Instance of this type are validated by templateId
Logical Container: ClinicalDocument (CDA Class)
\".\"\".\"\".\" Slices for templateId 1..*IISlice: Unordered, Open by value:root, value:extension
\".\"\".\"\".\"\".\" templateId:section 1..1II
\".\"\".\"\".\"\".\"\".\" @root 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.10.20.22.2.28
\".\"\".\"\".\"\".\"\".\" @extension 1..1stRequired Pattern: 2015-08-01
\".\"\".\"\".\" code 1..1CEProcedure findings Narrative
\".\"\".\"\".\"\".\" @code 1..1csRequired Pattern: 59776-5
\".\"\".\"\".\"\".\" @codeSystem 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.6.1
\".\"\".\"\".\" title 1..1ST
\".\"\".\"\".\" text 1..1xhtml
\".\"\".\"\".\" Slices for entry 0..*EntrySlice: Unordered, Open by profile:observation
\".\"\".\"\".\"\".\" entry:problem 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1ProblemObservation

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-target","_valueBoolean":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/data-absent-reason","valueCode":"not-applicable"}]}},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:v3"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"section"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-container","valueUri":"http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/type-profile-style","valueCode":"cda"}],"url":"http://hl7.org/cda/us/ccda/StructureDefinition/ProcedureFindingsSection","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:hl7ii:2.16.840.1.113883.10.20.22.2.28:2015-08-01"}],"version":"4.0.0","name":"ProcedureFindingsSection","title":"Procedure Findings Section","status":"draft","date":"2025-06-20T08:22:30+08:00","publisher":"Health Level Seven","contact":[{"name":"HL7 International - Structured Documents","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/structure"}]}],"description":"The Procedure Findings Section records clinically significant observations confirmed or discovered during a procedure or surgery.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US"}]}],"fhirVersion":"5.0.0","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"logical","abstract":false,"type":"http://hl7.org/cda/stds/core/StructureDefinition/Section","baseDefinition":"http://hl7.org/cda/stds/core/StructureDefinition/Section","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"2.0.1-sd"}],"element":[{"id":"Section","path":"Section","short":"Base for all types and resources","definition":"Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.","min":1,"max":"1","base":{"path":"Base","min":0,"max":"*"},"isModifier":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Section.nullFlavor","path":"Section.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.realmCode","path":"Section.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.typeId","path":"Section.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.typeId.nullFlavor","path":"Section.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.typeId.assigningAuthorityName","path":"Section.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.typeId.displayable","path":"Section.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.typeId.root","path":"Section.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.typeId.extension","path":"Section.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.templateId","path":"Section.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.templateId:section","path":"Section.templateId","sliceName":"section","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"1","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.templateId:section.nullFlavor","path":"Section.templateId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.templateId:section.assigningAuthorityName","path":"Section.templateId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.templateId:section.displayable","path":"Section.templateId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.templateId:section.root","path":"Section.templateId.root","representation":["xmlAttr"],"label":"Root","definition":"A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.10.20.22.2.28"},{"id":"Section.templateId:section.extension","path":"Section.templateId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}],"patternString":"2015-08-01"},{"id":"Section.ID","path":"Section.ID","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.ID","min":0,"max":"1"},"type":[{"code":"id","profile":["http://hl7.org/cda/stds/core/StructureDefinition/xs-ID"]}]},{"id":"Section.classCode","path":"Section.classCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.classCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"DOCSECT","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActClassRecordOrganizer"}},{"id":"Section.moodCode","path":"Section.moodCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.moodCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"EVN","binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAActMood"}},{"id":"Section.id","path":"Section.id","min":0,"max":"1","base":{"path":"Section.id","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.code","path":"Section.code","short":"Procedure findings Narrative","min":1,"max":"1","base":{"path":"Section.code","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}]},{"id":"Section.code.nullFlavor","path":"Section.code.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.code.code","path":"Section.code.code","representation":["xmlAttr"],"label":"Code","definition":"The plain code symbol defined by the code system. For example, \"784.0\" is the code symbol of the ICD-9 code \"784.0\" for headache.","min":1,"max":"1","base":{"path":"CD.code","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"patternCode":"59776-5"},{"id":"Section.code.codeSystem","path":"Section.code.codeSystem","representation":["xmlAttr"],"label":"Code System","definition":"Specifies the code system that defines the code.","min":1,"max":"1","base":{"path":"CD.codeSystem","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.6.1"},{"id":"Section.code.codeSystemName","path":"Section.code.codeSystemName","representation":["xmlAttr"],"label":"Code System Name","definition":"The common name of the coding system.","min":0,"max":"1","base":{"path":"CD.codeSystemName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.codeSystemVersion","path":"Section.code.codeSystemVersion","representation":["xmlAttr"],"label":"Code System Version","definition":"If applicable, a version descriptor defined specifically for the given code system.","min":0,"max":"1","base":{"path":"CD.codeSystemVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.displayName","path":"Section.code.displayName","representation":["xmlAttr"],"label":"Display Name","definition":"A name or title for the code, under which the sending system shows the code value to its users.","min":0,"max":"1","base":{"path":"CD.displayName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.sdtcValueSet","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSet"}],"path":"Section.code.sdtcValueSet","representation":["xmlAttr"],"definition":"The valueSet extension adds an attribute for elements with a CD dataType which indicates the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.valueSet","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid"]}]},{"id":"Section.code.sdtcValueSetVersion","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSetVersion"}],"path":"Section.code.sdtcValueSetVersion","representation":["xmlAttr"],"definition":"The valueSetVersion extension adds an attribute for elements with a CD dataType which indicates the version of the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.sdtcValueSetVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.originalText","path":"Section.code.originalText","label":"Original Text","definition":"The text or phrase used as the basis for the coding.","min":0,"max":"1","base":{"path":"CD.originalText","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Section.code.qualifier","path":"Section.code.qualifier","label":"Qualifier","definition":"Specifies additional codes that increase the specificity of the the primary code.","min":0,"max":"0","base":{"path":"CD.qualifier","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CR"}]},{"id":"Section.code.translation","path":"Section.code.translation","representation":["typeAttr"],"label":"Translation","definition":"A set of other concept descriptors that translate this concept descriptor into other code systems.","min":0,"max":"*","base":{"path":"CD.translation","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Section.title","path":"Section.title","min":1,"max":"1","base":{"path":"Section.title","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ST"}]},{"id":"Section.text","path":"Section.text","representation":["cdaText"],"min":1,"max":"1","base":{"path":"Section.text","min":0,"max":"1"},"type":[{"code":"xhtml"}]},{"id":"Section.confidentialityCode","path":"Section.confidentialityCode","min":0,"max":"1","base":{"path":"Section.confidentialityCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}]},{"id":"Section.languageCode","path":"Section.languageCode","min":0,"max":"1","base":{"path":"Section.languageCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}],"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/all-languages"}},{"id":"Section.subject","path":"Section.subject","min":0,"max":"1","base":{"path":"Section.subject","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Subject"}]},{"id":"Section.author","path":"Section.author","min":0,"max":"*","base":{"path":"Section.author","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Author"}]},{"id":"Section.informant","path":"Section.informant","min":0,"max":"*","base":{"path":"Section.informant","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Informant"}]},{"id":"Section.entry","path":"Section.entry","slicing":{"discriminator":[{"type":"profile","path":"observation"}],"rules":"open"},"min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:problem","path":"Section.entry","sliceName":"problem","comment":"MAY contain zero or more [0..*] entry (CONF:1198-8090) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:problem.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:problem.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:problem.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:problem.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:problem.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:problem.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:problem.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:problem.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:problem.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:problem.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:problem.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:problem.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:problem.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:problem.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Problem Observation (identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.4:2015-08-01) (CONF:1198-15507).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/ProblemObservation"]}]},{"id":"Section.entry:problem.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:problem.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:problem.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:problem.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:problem.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:problem.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.component","path":"Section.component","min":0,"max":"*","base":{"path":"Section.component","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.component.nullFlavor","path":"Section.component.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.component.realmCode","path":"Section.component.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.component.typeId","path":"Section.component.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/Section"}]},{"id":"Section.component.typeId.nullFlavor","path":"Section.component.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.component.typeId.assigningAuthorityName","path":"Section.component.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.component.typeId.displayable","path":"Section.component.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.component.typeId.root","path":"Section.component.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.component.typeId.extension","path":"Section.component.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.component.templateId","path":"Section.component.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.component.typeCode","path":"Section.component.typeCode","representation":["xmlAttr"],"definition":"Drawn from concept domain DocumentSectionType","min":0,"max":"1","base":{"path":"Section.component.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"COMP"},{"id":"Section.component.contextConductionInd","path":"Section.component.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.component.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.component.section","path":"Section.component.section","min":1,"max":"1","base":{"path":"Section.component.section","min":1,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Section"}]}]},"differential":{"element":[{"id":"Section.templateId","path":"Section.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"min":1},{"id":"Section.templateId:section","path":"Section.templateId","sliceName":"section","min":1,"max":"1"},{"id":"Section.templateId:section.root","path":"Section.templateId.root","min":1,"patternString":"2.16.840.1.113883.10.20.22.2.28"},{"id":"Section.templateId:section.extension","path":"Section.templateId.extension","min":1,"patternString":"2015-08-01"},{"id":"Section.code","path":"Section.code","short":"Procedure findings Narrative","min":1},{"id":"Section.code.code","path":"Section.code.code","min":1,"patternCode":"59776-5"},{"id":"Section.code.codeSystem","path":"Section.code.codeSystem","min":1,"patternString":"2.16.840.1.113883.6.1"},{"id":"Section.title","path":"Section.title","min":1},{"id":"Section.text","path":"Section.text","min":1},{"id":"Section.entry","path":"Section.entry","slicing":{"discriminator":[{"type":"profile","path":"observation"}],"rules":"open"}},{"id":"Section.entry:problem","path":"Section.entry","sliceName":"problem","comment":"MAY contain zero or more [0..*] entry (CONF:1198-8090) such that it","min":0,"max":"*"},{"id":"Section.entry:problem.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Problem Observation (identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.4:2015-08-01) (CONF:1198-15507).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/ProblemObservation"]}]}]}} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-SocialHistorySection.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-SocialHistorySection.json new file mode 100644 index 000000000..bdefd09c2 --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources/StructureDefinition-SocialHistorySection.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"SocialHistorySection","text":{"status":"extensions","div":"

Generated Narrative: StructureDefinition SocialHistorySection

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
NameFlagsCard.TypeDescription & Constraints\"doco\"
\".\"\".\" Section C1..1SectionXML Namespace: urn:hl7-org:v3
Elements defined in Ancestors:@nullFlavor, realmCode, typeId, templateId, @ID, @classCode, @moodCode, id, code, title, text, confidentialityCode, languageCode, subject, author, informant, entry, component
Base for all types and resources
Instance of this type are validated by templateId
Logical Container: ClinicalDocument (CDA Class)
Constraints: should-smoking-status
\".\"\".\"\".\" Slices for templateId 1..*IISlice: Unordered, Open by value:root, value:extension
\".\"\".\"\".\"\".\" templateId:section 1..1II
\".\"\".\"\".\"\".\"\".\" @root 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.10.20.22.2.17
\".\"\".\"\".\"\".\"\".\" @extension 1..1stRequired Pattern: 2015-08-01
\".\"\".\"\".\" code 1..1CESocial history Narrative
\".\"\".\"\".\"\".\" @code 1..1csRequired Pattern: 29762-2
\".\"\".\"\".\"\".\" @codeSystem 1..1oid, uuid, ruidRequired Pattern: 2.16.840.1.113883.6.1
\".\"\".\"\".\" title 1..1ST
\".\"\".\"\".\" text 1..1xhtml
\".\"\".\"\".\" Slices for entry 0..*EntrySlice: Unordered, Open by profile:observation
\".\"\".\"\".\"\".\" entry:socialHistory 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1SocialHistoryObservation
\".\"\".\"\".\"\".\" entry:pregnancyPregnancy 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1PregnancyStatusObservation
\".\"\".\"\".\"\".\" entry:smokingStatus 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1SmokingStatus
\".\"\".\"\".\"\".\" entry:caregiver 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1CaregiverCharacteristics
\".\"\".\"\".\"\".\" entry:culturalReligious 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1CulturalandReligiousObservation
\".\"\".\"\".\"\".\" entry:homeCharacteristics 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1CharacteristicsofHomeEnvironment
\".\"\".\"\".\"\".\" entry:pregnancyIntention 0..*Entry
\".\"\".\"\".\"\".\"\".\" observation 1..1PregnancyIntentionInNextYear

\"doco\" Documentation for this format
"},"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-target","_valueBoolean":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/data-absent-reason","valueCode":"not-applicable"}]}},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:v3"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"section"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/logical-container","valueUri":"http://hl7.org/cda/stds/core/StructureDefinition/ClinicalDocument"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/type-profile-style","valueCode":"cda"}],"url":"http://hl7.org/cda/us/ccda/StructureDefinition/SocialHistorySection","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:hl7ii:2.16.840.1.113883.10.20.22.2.17:2015-08-01"}],"version":"4.0.0","name":"SocialHistorySection","title":"Social History Section","status":"draft","date":"2025-06-20T08:22:30+08:00","publisher":"Health Level Seven","contact":[{"name":"HL7 International - Structured Documents","telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/structure"}]}],"description":"This section contains social history data that influence a patient's physical, psychological or emotional health (e.g., smoking status, pregnancy). Demographic data, such as marital status, race, ethnicity, and religious affiliation, is captured in the header. Mental/behavioral health assessments such as PHQ-9 (Patient Health Questionnaire-9) for depression screening are captured in the Mental Status section.\n\n#### Templates Used\nAlthough open templates may contain any valid CDA content, the following templates are specifically called out by this template:\n\n**Recommended Entries**: [SmokingStatus](StructureDefinition-SmokingStatus.html)\n\n**Optional Entries**: [CaregiverCharacteristics](StructureDefinition-CaregiverCharacteristics.html), [CharacteristicsofHomeEnvironment](StructureDefinition-CharacteristicsofHomeEnvironment.html), [CulturalandReligiousObservation](StructureDefinition-CulturalandReligiousObservation.html), [PregnancyIntentionInNextYear](StructureDefinition-PregnancyIntentionInNextYear.html), [PregnancyStatusObservation](StructureDefinition-PregnancyStatusObservation.html), [SocialHistoryObservation](StructureDefinition-SocialHistoryObservation.html)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US"}]}],"fhirVersion":"5.0.0","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"logical","abstract":false,"type":"http://hl7.org/cda/stds/core/StructureDefinition/Section","baseDefinition":"http://hl7.org/cda/stds/core/StructureDefinition/Section","derivation":"constraint","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"2.0.1-sd"}],"element":[{"id":"Section","path":"Section","short":"Base for all types and resources","definition":"Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.","min":1,"max":"1","base":{"path":"Base","min":0,"max":"*"},"constraint":[{"key":"should-smoking-status","severity":"warning","human":"SHOULD contain Smoking Status","expression":"entry.where(observation.hasTemplateIdOf('http://hl7.org/cda/us/ccda/StructureDefinition/SmokingStatus'))","source":"http://hl7.org/cda/us/ccda/StructureDefinition/SocialHistorySection"}],"isModifier":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Section.nullFlavor","path":"Section.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.realmCode","path":"Section.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.typeId","path":"Section.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.typeId.nullFlavor","path":"Section.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.typeId.assigningAuthorityName","path":"Section.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.typeId.displayable","path":"Section.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.typeId.root","path":"Section.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.typeId.extension","path":"Section.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.templateId","path":"Section.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.templateId:section","path":"Section.templateId","sliceName":"section","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":1,"max":"1","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.templateId:section.nullFlavor","path":"Section.templateId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.templateId:section.assigningAuthorityName","path":"Section.templateId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.templateId:section.displayable","path":"Section.templateId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.templateId:section.root","path":"Section.templateId.root","representation":["xmlAttr"],"label":"Root","definition":"A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.10.20.22.2.17"},{"id":"Section.templateId:section.extension","path":"Section.templateId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}],"patternString":"2015-08-01"},{"id":"Section.ID","path":"Section.ID","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.ID","min":0,"max":"1"},"type":[{"code":"id","profile":["http://hl7.org/cda/stds/core/StructureDefinition/xs-ID"]}]},{"id":"Section.classCode","path":"Section.classCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.classCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"DOCSECT","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActClassRecordOrganizer"}},{"id":"Section.moodCode","path":"Section.moodCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.moodCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"EVN","binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDAActMood"}},{"id":"Section.id","path":"Section.id","min":0,"max":"1","base":{"path":"Section.id","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.code","path":"Section.code","short":"Social history Narrative","min":1,"max":"1","base":{"path":"Section.code","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}]},{"id":"Section.code.nullFlavor","path":"Section.code.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.code.code","path":"Section.code.code","representation":["xmlAttr"],"label":"Code","definition":"The plain code symbol defined by the code system. For example, \"784.0\" is the code symbol of the ICD-9 code \"784.0\" for headache.","min":1,"max":"1","base":{"path":"CD.code","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"patternCode":"29762-2"},{"id":"Section.code.codeSystem","path":"Section.code.codeSystem","representation":["xmlAttr"],"label":"Code System","definition":"Specifies the code system that defines the code.","min":1,"max":"1","base":{"path":"CD.codeSystem","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"patternString":"2.16.840.1.113883.6.1"},{"id":"Section.code.codeSystemName","path":"Section.code.codeSystemName","representation":["xmlAttr"],"label":"Code System Name","definition":"The common name of the coding system.","min":0,"max":"1","base":{"path":"CD.codeSystemName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.codeSystemVersion","path":"Section.code.codeSystemVersion","representation":["xmlAttr"],"label":"Code System Version","definition":"If applicable, a version descriptor defined specifically for the given code system.","min":0,"max":"1","base":{"path":"CD.codeSystemVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.displayName","path":"Section.code.displayName","representation":["xmlAttr"],"label":"Display Name","definition":"A name or title for the code, under which the sending system shows the code value to its users.","min":0,"max":"1","base":{"path":"CD.displayName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.sdtcValueSet","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSet"}],"path":"Section.code.sdtcValueSet","representation":["xmlAttr"],"definition":"The valueSet extension adds an attribute for elements with a CD dataType which indicates the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.valueSet","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid"]}]},{"id":"Section.code.sdtcValueSetVersion","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-namespace","valueUri":"urn:hl7-org:sdtc"},{"url":"http://hl7.org/fhir/tools/StructureDefinition/xml-name","valueString":"valueSetVersion"}],"path":"Section.code.sdtcValueSetVersion","representation":["xmlAttr"],"definition":"The valueSetVersion extension adds an attribute for elements with a CD dataType which indicates the version of the particular value set constraining the coded concept.","min":0,"max":"1","base":{"path":"CD.sdtcValueSetVersion","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.code.originalText","path":"Section.code.originalText","label":"Original Text","definition":"The text or phrase used as the basis for the coding.","min":0,"max":"1","base":{"path":"CD.originalText","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ED"}]},{"id":"Section.code.qualifier","path":"Section.code.qualifier","label":"Qualifier","definition":"Specifies additional codes that increase the specificity of the the primary code.","min":0,"max":"0","base":{"path":"CD.qualifier","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CR"}]},{"id":"Section.code.translation","path":"Section.code.translation","representation":["typeAttr"],"label":"Translation","definition":"A set of other concept descriptors that translate this concept descriptor into other code systems.","min":0,"max":"*","base":{"path":"CD.translation","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CD"}]},{"id":"Section.title","path":"Section.title","min":1,"max":"1","base":{"path":"Section.title","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ST"}]},{"id":"Section.text","path":"Section.text","representation":["cdaText"],"min":1,"max":"1","base":{"path":"Section.text","min":0,"max":"1"},"type":[{"code":"xhtml"}]},{"id":"Section.confidentialityCode","path":"Section.confidentialityCode","min":0,"max":"1","base":{"path":"Section.confidentialityCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CE"}]},{"id":"Section.languageCode","path":"Section.languageCode","min":0,"max":"1","base":{"path":"Section.languageCode","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}],"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/all-languages"}},{"id":"Section.subject","path":"Section.subject","min":0,"max":"1","base":{"path":"Section.subject","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Subject"}]},{"id":"Section.author","path":"Section.author","min":0,"max":"*","base":{"path":"Section.author","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Author"}]},{"id":"Section.informant","path":"Section.informant","min":0,"max":"*","base":{"path":"Section.informant","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Informant"}]},{"id":"Section.entry","path":"Section.entry","slicing":{"discriminator":[{"type":"profile","path":"observation"}],"rules":"open"},"min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:socialHistory","path":"Section.entry","sliceName":"socialHistory","comment":"MAY contain zero or more [0..*] entry (CONF:1198-7953) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:socialHistory.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:socialHistory.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:socialHistory.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:socialHistory.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:socialHistory.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:socialHistory.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:socialHistory.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:socialHistory.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:socialHistory.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:socialHistory.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:socialHistory.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:socialHistory.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:socialHistory.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:socialHistory.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Social History Observation (identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.38:2015-08-01) (CONF:1198-14821).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/SocialHistoryObservation"]}]},{"id":"Section.entry:socialHistory.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:socialHistory.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:socialHistory.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:socialHistory.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:socialHistory.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:socialHistory.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.entry:pregnancyPregnancy","path":"Section.entry","sliceName":"pregnancyPregnancy","comment":"MAY contain zero or more [0..*] entry (CONF:1198-9132) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:pregnancyPregnancy.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:pregnancyPregnancy.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:pregnancyPregnancy.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:pregnancyPregnancy.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:pregnancyPregnancy.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:pregnancyPregnancy.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:pregnancyPregnancy.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:pregnancyPregnancy.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:pregnancyPregnancy.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:pregnancyPregnancy.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:pregnancyPregnancy.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:pregnancyPregnancy.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:pregnancyPregnancy.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:pregnancyPregnancy.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Pregnancy Status Observation (identifier: urn:oid:2.16.840.1.113883.10.20.15.3.8) (CONF:1198-14822).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/PregnancyStatusObservation"]}]},{"id":"Section.entry:pregnancyPregnancy.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:pregnancyPregnancy.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:pregnancyPregnancy.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:pregnancyPregnancy.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:pregnancyPregnancy.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:pregnancyPregnancy.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.entry:smokingStatus","path":"Section.entry","sliceName":"smokingStatus","comment":"SHOULD contain zero or more [0..*] entry (CONF:1198-14823) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:smokingStatus.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:smokingStatus.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:smokingStatus.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:smokingStatus.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:smokingStatus.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:smokingStatus.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:smokingStatus.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:smokingStatus.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:smokingStatus.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:smokingStatus.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:smokingStatus.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:smokingStatus.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:smokingStatus.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:smokingStatus.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Smoking Status(identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.511:2024-05-01) (CONF:1198-14824).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/SmokingStatus"]}]},{"id":"Section.entry:smokingStatus.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:smokingStatus.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:smokingStatus.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:smokingStatus.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:smokingStatus.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:smokingStatus.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.entry:caregiver","path":"Section.entry","sliceName":"caregiver","comment":"MAY contain zero or more [0..*] entry (CONF:1198-28361) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:caregiver.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:caregiver.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:caregiver.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:caregiver.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:caregiver.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:caregiver.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:caregiver.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:caregiver.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:caregiver.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:caregiver.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:caregiver.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:caregiver.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:caregiver.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:caregiver.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Caregiver Characteristics (identifier: urn:oid:2.16.840.1.113883.10.20.22.4.72) (CONF:1198-28362).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/CaregiverCharacteristics"]}]},{"id":"Section.entry:caregiver.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:caregiver.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:caregiver.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:caregiver.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:caregiver.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:caregiver.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.entry:culturalReligious","path":"Section.entry","sliceName":"culturalReligious","comment":"MAY contain zero or more [0..*] entry (CONF:1198-28366) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:culturalReligious.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:culturalReligious.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:culturalReligious.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:culturalReligious.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:culturalReligious.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:culturalReligious.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:culturalReligious.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:culturalReligious.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:culturalReligious.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:culturalReligious.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:culturalReligious.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:culturalReligious.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:culturalReligious.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:culturalReligious.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Cultural and Religious Observation (identifier: urn:oi\n d:2.16.840.1.113883.10.20.22.4.111) (CONF:1198-28367).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/CulturalandReligiousObservation"]}]},{"id":"Section.entry:culturalReligious.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:culturalReligious.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:culturalReligious.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:culturalReligious.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:culturalReligious.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:culturalReligious.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.entry:homeCharacteristics","path":"Section.entry","sliceName":"homeCharacteristics","comment":"MAY contain zero or more [0..*] entry (CONF:1198-28825) such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:homeCharacteristics.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:homeCharacteristics.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:homeCharacteristics.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:homeCharacteristics.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:homeCharacteristics.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:homeCharacteristics.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:homeCharacteristics.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:homeCharacteristics.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:homeCharacteristics.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:homeCharacteristics.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:homeCharacteristics.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:homeCharacteristics.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:homeCharacteristics.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:homeCharacteristics.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Characteristics of Home Environment (identifier: urn:oid:2.16.840.1.113883.10.20.22.4.109) (CONF:1198-28826).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/CharacteristicsofHomeEnvironment"]}]},{"id":"Section.entry:homeCharacteristics.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:homeCharacteristics.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:homeCharacteristics.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:homeCharacteristics.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:homeCharacteristics.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:homeCharacteristics.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.entry:pregnancyIntention","path":"Section.entry","sliceName":"pregnancyIntention","comment":"MAY contain zero or more [0..*] entry such that it","min":0,"max":"*","base":{"path":"Section.entry","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Entry"}]},{"id":"Section.entry:pregnancyIntention.nullFlavor","path":"Section.entry.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:pregnancyIntention.realmCode","path":"Section.entry.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.entry:pregnancyIntention.typeId","path":"Section.entry.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.entry:pregnancyIntention.typeId.nullFlavor","path":"Section.entry.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.entry:pregnancyIntention.typeId.assigningAuthorityName","path":"Section.entry.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:pregnancyIntention.typeId.displayable","path":"Section.entry.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.entry:pregnancyIntention.typeId.root","path":"Section.entry.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.entry:pregnancyIntention.typeId.extension","path":"Section.entry.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.entry:pregnancyIntention.templateId","path":"Section.entry.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.entry:pregnancyIntention.typeCode","path":"Section.entry.typeCode","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"defaultValueCode":"COMP","binding":{"strength":"required","valueSet":"http://terminology.hl7.org/ValueSet/v3-xActRelationshipEntry"}},{"id":"Section.entry:pregnancyIntention.contextConductionInd","path":"Section.entry.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Entry.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.entry:pregnancyIntention.act","path":"Section.entry.act","min":0,"max":"1","base":{"path":"Entry.act","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Act"}]},{"id":"Section.entry:pregnancyIntention.encounter","path":"Section.entry.encounter","min":0,"max":"1","base":{"path":"Entry.encounter","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Encounter"}]},{"id":"Section.entry:pregnancyIntention.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Pregnancy Intention In Next Year (identifier: urn:oid:2.16.840.1.113883.10.20.22.4.281:2023-05-01).","min":1,"max":"1","base":{"path":"Entry.observation","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/PregnancyIntentionInNextYear"]}]},{"id":"Section.entry:pregnancyIntention.observationMedia","path":"Section.entry.observationMedia","min":0,"max":"1","base":{"path":"Entry.observationMedia","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/ObservationMedia"}]},{"id":"Section.entry:pregnancyIntention.organizer","path":"Section.entry.organizer","min":0,"max":"1","base":{"path":"Entry.organizer","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Organizer"}]},{"id":"Section.entry:pregnancyIntention.procedure","path":"Section.entry.procedure","min":0,"max":"1","base":{"path":"Entry.procedure","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Procedure"}]},{"id":"Section.entry:pregnancyIntention.regionOfInterest","path":"Section.entry.regionOfInterest","min":0,"max":"1","base":{"path":"Entry.regionOfInterest","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/RegionOfInterest"}]},{"id":"Section.entry:pregnancyIntention.substanceAdministration","path":"Section.entry.substanceAdministration","min":0,"max":"1","base":{"path":"Entry.substanceAdministration","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/SubstanceAdministration"}]},{"id":"Section.entry:pregnancyIntention.supply","path":"Section.entry.supply","min":0,"max":"1","base":{"path":"Entry.supply","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Supply"}]},{"id":"Section.component","path":"Section.component","min":0,"max":"*","base":{"path":"Section.component","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/InfrastructureRoot"}]},{"id":"Section.component.nullFlavor","path":"Section.component.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.component.realmCode","path":"Section.component.realmCode","definition":"When valued in an instance, this attribute signals the imposition of realm-specific constraints. The value of this attribute identifies the realm in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.realmCode","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/CS"}]},{"id":"Section.component.typeId","path":"Section.component.typeId","definition":"When valued in an instance, this attribute signals the imposition of constraints defined in an HL7-specified message type. This might be a common type (also known as CMET in the messaging communication environment), or content included within a wrapper. The value of this attribute provides a unique identifier for the type in question.","min":0,"max":"1","base":{"path":"InfrastructureRoot.typeId","min":0,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}],"constraint":[{"key":"II-1","severity":"error","human":"An II instance must have either a root or an nullFlavor.","expression":"root.exists() or nullFlavor.exists()","source":"http://hl7.org/cda/stds/core/StructureDefinition/Section"}]},{"id":"Section.component.typeId.nullFlavor","path":"Section.component.typeId.nullFlavor","representation":["xmlAttr"],"label":"Exceptional Value Detail","definition":"If a value is an exceptional value (NULL-value), this specifies in what way and why proper information is missing.","min":0,"max":"1","base":{"path":"ANY.nullFlavor","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"binding":{"strength":"required","valueSet":"http://hl7.org/cda/stds/core/ValueSet/CDANullFlavor"}},{"id":"Section.component.typeId.assigningAuthorityName","path":"Section.component.typeId.assigningAuthorityName","representation":["xmlAttr"],"label":"Assigning Authority Name","definition":"A human readable name or mnemonic for the assigning authority. The Assigning Authority Name has no computational value. The purpose of a Assigning Authority Name is to assist an unaided human interpreter of an II value to interpret the authority. Note: no automated processing must depend on the assigning authority name to be present in any form.","min":0,"max":"1","base":{"path":"II.assigningAuthorityName","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.component.typeId.displayable","path":"Section.component.typeId.displayable","representation":["xmlAttr"],"label":"Displayable","definition":"Specifies if the identifier is intended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).","min":0,"max":"1","base":{"path":"II.displayable","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}]},{"id":"Section.component.typeId.root","path":"Section.component.typeId.root","representation":["xmlAttr"],"label":"Root","definition":"Identifies the type as an HL7 Registered model","min":1,"max":"1","base":{"path":"II.root","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/oid","http://hl7.org/cda/stds/core/StructureDefinition/uuid","http://hl7.org/cda/stds/core/StructureDefinition/ruid"]}],"fixedString":"2.16.840.1.113883.1.3"},{"id":"Section.component.typeId.extension","path":"Section.component.typeId.extension","representation":["xmlAttr"],"label":"Extension","definition":"A character string as a unique identifier within the scope of the identifier root.","min":1,"max":"1","base":{"path":"II.extension","min":0,"max":"1"},"type":[{"code":"string","profile":["http://hl7.org/cda/stds/core/StructureDefinition/st-simple"]}]},{"id":"Section.component.templateId","path":"Section.component.templateId","definition":"When valued in an instance, this attribute signals the imposition of a set of template-defined constraints. The value of this attribute provides a unique identifier for the templates in question","min":0,"max":"*","base":{"path":"InfrastructureRoot.templateId","min":0,"max":"*"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/II"}]},{"id":"Section.component.typeCode","path":"Section.component.typeCode","representation":["xmlAttr"],"definition":"Drawn from concept domain DocumentSectionType","min":0,"max":"1","base":{"path":"Section.component.typeCode","min":0,"max":"1"},"type":[{"code":"code","profile":["http://hl7.org/cda/stds/core/StructureDefinition/cs-simple"]}],"fixedCode":"COMP"},{"id":"Section.component.contextConductionInd","path":"Section.component.contextConductionInd","representation":["xmlAttr"],"min":0,"max":"1","base":{"path":"Section.component.contextConductionInd","min":0,"max":"1"},"type":[{"code":"boolean","profile":["http://hl7.org/cda/stds/core/StructureDefinition/bl-simple"]}],"fixedBoolean":true},{"id":"Section.component.section","path":"Section.component.section","min":1,"max":"1","base":{"path":"Section.component.section","min":1,"max":"1"},"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Section"}]}]},"differential":{"element":[{"id":"Section","path":"Section","constraint":[{"key":"should-smoking-status","severity":"warning","human":"SHOULD contain Smoking Status","expression":"entry.where(observation.hasTemplateIdOf('http://hl7.org/cda/us/ccda/StructureDefinition/SmokingStatus'))","source":"http://hl7.org/cda/us/ccda/StructureDefinition/SocialHistorySection"}]},{"id":"Section.templateId","path":"Section.templateId","slicing":{"discriminator":[{"type":"value","path":"root"},{"type":"value","path":"extension"}],"rules":"open"},"min":1},{"id":"Section.templateId:section","path":"Section.templateId","sliceName":"section","min":1,"max":"1"},{"id":"Section.templateId:section.root","path":"Section.templateId.root","min":1,"patternString":"2.16.840.1.113883.10.20.22.2.17"},{"id":"Section.templateId:section.extension","path":"Section.templateId.extension","min":1,"patternString":"2015-08-01"},{"id":"Section.code","path":"Section.code","short":"Social history Narrative","min":1},{"id":"Section.code.code","path":"Section.code.code","min":1,"patternCode":"29762-2"},{"id":"Section.code.codeSystem","path":"Section.code.codeSystem","min":1,"patternString":"2.16.840.1.113883.6.1"},{"id":"Section.title","path":"Section.title","min":1},{"id":"Section.text","path":"Section.text","min":1},{"id":"Section.entry","path":"Section.entry","slicing":{"discriminator":[{"type":"profile","path":"observation"}],"rules":"open"}},{"id":"Section.entry:socialHistory","path":"Section.entry","sliceName":"socialHistory","comment":"MAY contain zero or more [0..*] entry (CONF:1198-7953) such that it","min":0,"max":"*"},{"id":"Section.entry:socialHistory.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Social History Observation (identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.38:2015-08-01) (CONF:1198-14821).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/SocialHistoryObservation"]}]},{"id":"Section.entry:pregnancyPregnancy","path":"Section.entry","sliceName":"pregnancyPregnancy","comment":"MAY contain zero or more [0..*] entry (CONF:1198-9132) such that it","min":0,"max":"*"},{"id":"Section.entry:pregnancyPregnancy.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Pregnancy Status Observation (identifier: urn:oid:2.16.840.1.113883.10.20.15.3.8) (CONF:1198-14822).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/PregnancyStatusObservation"]}]},{"id":"Section.entry:smokingStatus","path":"Section.entry","sliceName":"smokingStatus","comment":"SHOULD contain zero or more [0..*] entry (CONF:1198-14823) such that it","min":0,"max":"*"},{"id":"Section.entry:smokingStatus.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Smoking Status(identifier: urn:hl7ii:2.16.840.1.113883.10.20.22.4.511:2024-05-01) (CONF:1198-14824).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/SmokingStatus"]}]},{"id":"Section.entry:caregiver","path":"Section.entry","sliceName":"caregiver","comment":"MAY contain zero or more [0..*] entry (CONF:1198-28361) such that it","min":0,"max":"*"},{"id":"Section.entry:caregiver.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Caregiver Characteristics (identifier: urn:oid:2.16.840.1.113883.10.20.22.4.72) (CONF:1198-28362).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/CaregiverCharacteristics"]}]},{"id":"Section.entry:culturalReligious","path":"Section.entry","sliceName":"culturalReligious","comment":"MAY contain zero or more [0..*] entry (CONF:1198-28366) such that it","min":0,"max":"*"},{"id":"Section.entry:culturalReligious.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Cultural and Religious Observation (identifier: urn:oi\n d:2.16.840.1.113883.10.20.22.4.111) (CONF:1198-28367).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/CulturalandReligiousObservation"]}]},{"id":"Section.entry:homeCharacteristics","path":"Section.entry","sliceName":"homeCharacteristics","comment":"MAY contain zero or more [0..*] entry (CONF:1198-28825) such that it","min":0,"max":"*"},{"id":"Section.entry:homeCharacteristics.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Characteristics of Home Environment (identifier: urn:oid:2.16.840.1.113883.10.20.22.4.109) (CONF:1198-28826).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/CharacteristicsofHomeEnvironment"]}]},{"id":"Section.entry:pregnancyIntention","path":"Section.entry","sliceName":"pregnancyIntention","comment":"MAY contain zero or more [0..*] entry such that it","min":0,"max":"*"},{"id":"Section.entry:pregnancyIntention.observation","path":"Section.entry.observation","comment":"SHALL contain exactly one [1..1] Pregnancy Intention In Next Year (identifier: urn:oid:2.16.840.1.113883.10.20.22.4.281:2023-05-01).","min":1,"type":[{"code":"http://hl7.org/cda/stds/core/StructureDefinition/Observation","profile":["http://hl7.org/cda/us/ccda/StructureDefinition/PregnancyIntentionInNextYear"]}]}]}} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system/r5-code-system-action-code.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system/r5-code-system-action-code.json new file mode 100644 index 000000000..99328e2f5 --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system/r5-code-system-action-code.json @@ -0,0 +1 @@ +{"resourceType": "CodeSystem", "id": "action-code", "meta": {"lastUpdated": "2023-03-26T04:21:02.749+00:00", "profile": ["http://hl7.org/fhir/StructureDefinition/shareablecodesystem"]}, "text": {"status": "generated", "div": "
\n

This code system \n http://hl7.org/fhir/action-code defines the following codes:\n

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Code\n \n Display\n \n Definition\n
send-message\n \n Send a messageThe action indicates that a particular message should be sent to a participant in the process.
collect-information\n \n Collect informationThe action indicates that information should be collected from a participant in the process.
prescribe-medication\n \n Prescribe a medicationThe action indicates that a particular medication should be prescribed to the patient.
recommend-immunization\n \n Recommend an immunizationThe action indicates that a particular immunization should be performed.
order-service\n \n Order a serviceThe action indicates that a particular service should be provided.
propose-diagnosis\n \n Propose a diagnosisThe action indicates that a particular diagnosis should be proposed.
record-detected-issue\n \n Record a detected issueThe action indicates that a particular detected issue should be recorded.
record-inference\n \n Record an inferenceThe action indicates that a particular inference should be recorded.
report-flag\n \n Report a flagThe action indicates that a particular flag should be reported.
\n
"}, "extension": [{"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", "valueCode": "cds"}, {"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", "valueCode": "draft"}, {"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", "valueInteger": 1}], "url": "http://hl7.org/fhir/action-code", "identifier": [{"system": "urn:ietf:rfc:3986", "value": "urn:oid:2.16.840.1.113883.4.642.4.1944"}], "version": "5.0.0", "name": "ActionCode", "title": "Action Code", "status": "active", "experimental": false, "date": "2020-12-28T05:55:11+00:00", "publisher": "HL7 (FHIR Project)", "contact": [{"telecom": [{"system": "url", "value": "http://hl7.org/fhir"}, {"system": "email", "value": "fhir@lists.hl7.org"}]}], "description": "Provides examples of actions to be performed.", "jurisdiction": [{"coding": [{"system": "http://unstats.un.org/unsd/methods/m49/m49.htm", "code": "001", "display": "World"}]}], "caseSensitive": true, "valueSet": "http://hl7.org/fhir/ValueSet/action-code", "content": "complete", "concept": [{"code": "send-message", "display": "Send a message", "definition": "The action indicates that a particular message should be sent to a participant in the process."}, {"code": "collect-information", "display": "Collect information", "definition": "The action indicates that information should be collected from a participant in the process."}, {"code": "prescribe-medication", "display": "Prescribe a medication", "definition": "The action indicates that a particular medication should be prescribed to the patient."}, {"code": "recommend-immunization", "display": "Recommend an immunization", "definition": "The action indicates that a particular immunization should be performed."}, {"code": "order-service", "display": "Order a service", "definition": "The action indicates that a particular service should be provided."}, {"code": "propose-diagnosis", "display": "Propose a diagnosis", "definition": "The action indicates that a particular diagnosis should be proposed."}, {"code": "record-detected-issue", "display": "Record a detected issue", "definition": "The action indicates that a particular detected issue should be recorded."}, {"code": "record-inference", "display": "Record an inference", "definition": "The action indicates that a particular inference should be recorded."}, {"code": "report-flag", "display": "Report a flag", "definition": "The action indicates that a particular flag should be reported."}]} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/concept-map/r5-concept-map-observation-status.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/concept-map/r5-concept-map-observation-status.json new file mode 100644 index 000000000..d084c0862 --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/concept-map/r5-concept-map-observation-status.json @@ -0,0 +1 @@ +{"contact": [{"telecom": [{"system": "url", "value": "http://hl7.org/fhir"}, {"system": "email", "value": "fhir@lists.hl7.org"}]}], "date": "2020-12-28T05:55:11+00:00", "description": "Canonical Mapping for \"Codes providing the status of an observation.\"", "experimental": false, "group": [{"element": [{"code": "entered-in-error", "target": [{"code": "error", "relationship": "equivalent"}]}, {"code": "preliminary", "target": [{"code": "draft", "relationship": "equivalent"}]}, {"code": "registered", "target": [{"code": "received", "relationship": "equivalent"}]}, {"code": "corrected", "target": [{"code": "replaced", "relationship": "equivalent"}]}, {"code": "amended", "target": [{"code": "replaced", "relationship": "equivalent"}]}, {"code": "final", "target": [{"code": "complete", "relationship": "equivalent"}]}, {"code": "cancelled", "target": [{"code": "abandoned", "relationship": "equivalent"}]}, {"code": "unknown", "target": [{"code": "unknown", "relationship": "equivalent"}]}], "source": "http://hl7.org/fhir/observation-status", "target": "http://hl7.org/fhir/resource-status"}], "id": "sc-observation-status", "jurisdiction": [{"coding": [{"code": "001", "display": "World", "system": "http://unstats.un.org/unsd/methods/m49/m49.htm"}]}], "name": "ObservationStatusCanonicalMap", "publisher": "HL7 (FHIR Project)", "resourceType": "ConceptMap", "sourceScopeCanonical": "http://hl7.org/fhir/ValueSet/observation-status", "status": "draft", "targetScopeCanonical": "http://hl7.org/fhir/ValueSet/resource-status", "text": {"div": "

ObservationStatusCanonicalMap (http://hl7.org/fhir/ConceptMap/sc-observation-status)

Mapping from Observation Status to Canonical Status Codes for FHIR Resources

DRAFT. Published on 2020-12-28T16:55:11+11:00 by HL7 (FHIR Project) (http://hl7.org/fhir, fhir@lists.hl7.org).

Canonical Mapping for "Codes providing the status of an observation."

\n

Group 1Mapping from Observation Status to Canonical Status Codes for FHIR Resources

Source CodeRelationshipTarget Code
entered-in-erroris equivalent toerror
preliminaryis equivalent todraft
registeredis equivalent toreceived
correctedis equivalent toreplaced
amendedis equivalent toreplaced
finalis equivalent tocomplete
cancelledis equivalent toabandoned
unknownis equivalent tounknown
", "status": "extensions"}, "title": "Canonical Mapping for \"Observation Status\"", "url": "http://hl7.org/fhir/ConceptMap/sc-observation-status", "version": "5.0.0"} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/structured-definition/r5-structured-definition-code.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/structured-definition/r5-structured-definition-code.json new file mode 100644 index 000000000..b6b716d8f --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/structured-definition/r5-structured-definition-code.json @@ -0,0 +1 @@ +{"resourceType" : "StructureDefinition", "id" : "code", "text" : {"status" : "generated", "div" : "
to do
"}, "extension" : [{"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", "valueCode" : "normative"}, {"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version", "valueCode" : "4.0.0"}, {"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics", "valueCode" : "can-bind"}, {"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics", "valueCode" : "has-length"}], "url" : "http://hl7.org/fhir/StructureDefinition/code", "version" : "5.0.0", "name" : "code", "status" : "active", "experimental" : false, "date" : "2023-03-26T15:21:02+11:00", "publisher" : "HL7 FHIR Standard", "contact" : [{"telecom" : [{"system" : "url", "value" : "http://hl7.org/fhir"}]}], "description" : "code type: A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents", "jurisdiction" : [{"coding" : [{"system" : "http://unstats.un.org/unsd/methods/m49/m49.htm", "code" : "001", "display" : "World"}]}], "fhirVersion" : "5.0.0", "kind" : "primitive-type", "abstract" : false, "type" : "code", "baseDefinition" : "http://hl7.org/fhir/StructureDefinition/string", "derivation" : "specialization", "snapshot" : {"element" : [{"id" : "code", "path" : "code", "short" : "Primitive Type code", "definition" : "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents", "min" : 0, "max" : "*", "base" : {"path" : "code", "min" : 0, "max" : "*"}, "constraint" : [{"key" : "ele-1", "severity" : "error", "human" : "All FHIR elements must have a @value or children", "expression" : "hasValue() or (children().count() > id.count())", "source" : "http://hl7.org/fhir/StructureDefinition/Element"}], "isModifier" : false, "isSummary" : false}, {"id" : "code.id", "path" : "code.id", "representation" : ["xmlAttr"], "short" : "xml:id (or equivalent in JSON)", "definition" : "unique id for the element within a resource (for internal references)", "min" : 0, "max" : "1", "base" : {"path" : "Element.id", "min" : 0, "max" : "1"}, "type" : [{"extension" : [{"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", "valueUrl" : "string"}], "code" : "http://hl7.org/fhirpath/System.String"}], "isModifier" : false, "isSummary" : false}, {"id" : "code.extension", "path" : "code.extension", "short" : "Additional content defined by implementations", "definition" : "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", "comment" : "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", "alias" : ["extensions", "user content"], "min" : 0, "max" : "*", "base" : {"path" : "Element.extension", "min" : 0, "max" : "*"}, "type" : [{"code" : "Extension"}], "constraint" : [{"key" : "ele-1", "severity" : "error", "human" : "All FHIR elements must have a @value or children", "expression" : "hasValue() or (children().count() > id.count())", "source" : "http://hl7.org/fhir/StructureDefinition/Element"}, {"key" : "ext-1", "severity" : "error", "human" : "Must have either extensions or value[x], not both", "expression" : "extension.exists() != value.exists()", "source" : "http://hl7.org/fhir/StructureDefinition/Extension"}], "isModifier" : false, "isSummary" : false}, {"id" : "code.value", "path" : "code.value", "representation" : ["xmlAttr"], "short" : "Primitive value for code", "definition" : "Primitive value for code", "min" : 0, "max" : "1", "base" : {"path" : "string.value", "min" : 0, "max" : "1"}, "type" : [{"extension" : [{"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", "valueUrl" : "code"}, {"url" : "http://hl7.org/fhir/StructureDefinition/regex", "valueString" : "[^\\s]+( [^\\s]+)*"}], "code" : "http://hl7.org/fhirpath/System.String"}], "isModifier" : false, "isSummary" : false}]}, "differential" : {"element" : [{"id" : "code", "path" : "code", "short" : "Primitive Type code", "definition" : "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents", "min" : 0, "max" : "*"}, {"id" : "code.value", "path" : "code.value", "representation" : ["xmlAttr"], "short" : "Primitive value for code", "definition" : "Primitive value for code", "min" : 0, "max" : "1", "type" : [{"extension" : [{"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", "valueUrl" : "code"}, {"url" : "http://hl7.org/fhir/StructureDefinition/regex", "valueString" : "[^\\s]+( [^\\s]+)*"}], "code" : "http://hl7.org/fhirpath/System.String"}]}]}} \ No newline at end of file diff --git a/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/valueset/r5-valueset-event-status.json b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/valueset/r5-valueset-event-status.json new file mode 100644 index 000000000..7e382db2b --- /dev/null +++ b/tooling/src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/valueset/r5-valueset-event-status.json @@ -0,0 +1 @@ +{"resourceType": "ValueSet", "id": "event-status", "meta": {"lastUpdated": "2023-03-26T04:21:02.749+00:00", "profile": ["http://hl7.org/fhir/StructureDefinition/shareablevalueset"]}, "text": {"status": "generated", "div": "
\n \n
"}, "extension": [{"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", "valueCode": "fhir"}, {"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status", "valueCode": "trial-use"}, {"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm", "valueInteger": 4}], "url": "http://hl7.org/fhir/ValueSet/event-status", "identifier": [{"system": "urn:ietf:rfc:3986", "value": "urn:oid:2.16.840.1.113883.4.642.3.109"}], "version": "5.0.0", "name": "EventStatus", "title": "EventStatus", "status": "draft", "experimental": true, "date": "2023-03-26T04:21:02+00:00", "publisher": "HL7 (FHIR Project)", "contact": [{"telecom": [{"system": "url", "value": "http://hl7.org/fhir"}, {"system": "email", "value": "fhir@lists.hl7.org"}]}], "description": "Codes identifying the lifecycle stage of an event.", "jurisdiction": [{"coding": [{"system": "http://unstats.un.org/unsd/methods/m49/m49.htm", "code": "001", "display": "World"}]}], "immutable": true, "compose": {"include": [{"system": "http://hl7.org/fhir/event-status"}]}} \ No newline at end of file From ae618f01f786401229afde5d2f67601e41172a3a Mon Sep 17 00:00:00 2001 From: raleigh-g-thompson Date: Fri, 14 Nov 2025 11:45:16 -0500 Subject: [PATCH 3/6] change default bundle type to transaction --- .../java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java index 55ad81644..b2a26e104 100644 --- a/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java +++ b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java @@ -60,7 +60,7 @@ public static List allowedBundleTypes() { // COMMAND LINE ARGUMENTS - OPTIONAL private String encoding = "json"; // -encoding (-e) private String bundleId = UUID.randomUUID().toString(); // -bundleid (-bid) - private String bundleType = "collection"; // -type (-t) + private String bundleType = "transaction"; // -type (-t) private String outputFileName = null; // -outputfilename (-ofn) private void extractOptionsFromArgs(String[] args) { From 65aa2cf41a222fa9f059460017999009a5efda06 Mon Sep 17 00:00:00 2001 From: raleigh-g-thompson Date: Fri, 14 Nov 2025 11:45:59 -0500 Subject: [PATCH 4/6] adds ConvertR5toR4 command to operation factory --- .../main/java/org/opencds/cqf/tooling/cli/OperationFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tooling-cli/src/main/java/org/opencds/cqf/tooling/cli/OperationFactory.java b/tooling-cli/src/main/java/org/opencds/cqf/tooling/cli/OperationFactory.java index b4e41173c..4a17cde13 100644 --- a/tooling-cli/src/main/java/org/opencds/cqf/tooling/cli/OperationFactory.java +++ b/tooling-cli/src/main/java/org/opencds/cqf/tooling/cli/OperationFactory.java @@ -223,6 +223,8 @@ static Operation createOperation(String operationName) { return new StripGeneratedContentOperation(); case "SpreadsheetValidateVSandCS": return new SpreadsheetValidateVSandCS(); + case "ConvertR5toR4": + return new ConvertR5toR4(); default: throw new IllegalArgumentException("Invalid operation: " + operationName); } From cab18a90f5d7b53763df48d4c9fef774aa3b019a Mon Sep 17 00:00:00 2001 From: raleigh-g-thompson Date: Tue, 25 Nov 2025 10:26:24 -0600 Subject: [PATCH 5/6] updates based on PR feedback --- .../cqf/tooling/operation/ConvertR5toR4.java | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java index b2a26e104..6d152eecc 100644 --- a/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java +++ b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java @@ -16,6 +16,7 @@ import org.opencds.cqf.tooling.utilities.BundleUtils; import org.opencds.cqf.tooling.utilities.FhirContextCache; import org.opencds.cqf.tooling.utilities.IOUtils; +import org.opencds.cqf.tooling.utilities.converters.ResourceAndTypeConverter; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.valueset.BundleTypeEnum; @@ -25,29 +26,23 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; - - public class ConvertR5toR4 extends Operation { - public enum AllowedBundleType { - COLLECTION(BundleTypeEnum.COLLECTION), - TRANSACTION(BundleTypeEnum.TRANSACTION); - - private final BundleTypeEnum reference; - AllowedBundleType(BundleTypeEnum reference) { - this.reference = reference; - } - - - } + public static final List ALLOWED_BUNDLE_TYPES = List.of( + BundleTypeEnum.COLLECTION, + BundleTypeEnum.TRANSACTION + ); public static Boolean isBundleTypeAllowed(String bundleType) { - return Arrays.stream(AllowedBundleType.values()) - .anyMatch(e -> e.name().equalsIgnoreCase(bundleType)); + if (bundleType == null) { + return false; + } + return ALLOWED_BUNDLE_TYPES.stream() + .anyMatch(bt -> bt.name().equalsIgnoreCase(bundleType)); } public static List allowedBundleTypes() { - return Arrays.stream(AllowedBundleType.values()) + return ALLOWED_BUNDLE_TYPES.stream() .map(Enum::name) .map(String::toLowerCase) .collect(Collectors.toList()); @@ -134,12 +129,11 @@ private void validatePathToDirectory() { } File[] resources = resourceDirectory.listFiles(); - if (resources == null) { + if (resources == null || resources.length == 0) { throw new RuntimeException(String.format("The specified path [%s] to resource files is empty", pathToDirectory)); } } - @Override public void execute(String[] args) { setOutputPath("src/main/resources/org/opencds/cqf/tooling/convert/output"); // default @@ -163,7 +157,7 @@ public void execute(String[] args) { IOUtils.writeResource( bundle, - getOutputPath() == null ? pathToDirectory : getOutputPath(), + getOutputPath(), IOUtils.Encoding.parse(encoding), FhirContextCache.getContext("r4"), true, @@ -173,23 +167,19 @@ public void execute(String[] args) { private IBaseBundle convertResources(String bundleId, BundleTypeEnum type, @Nonnull List resourcesToConvert) { - VersionConvertor_40_50 versionConverter4050 = new VersionConvertor_40_50(new BaseAdvisor_40_50(true)); - List convertedResources = new ArrayList<>(); for (IBaseResource resource: resourcesToConvert){ if (resource instanceof org.hl7.fhir.r5.model.Resource) { - convertedResources.add(versionConverter4050.convertResource((org.hl7.fhir.r5.model.Resource)resource)); + convertedResources.add(ResourceAndTypeConverter.r5ToR4Resource(resource)); } } FhirContext context = FhirContextCache.getContext("r4"); BundleBuilder builder = new BundleBuilder(context); if (type == BundleTypeEnum.COLLECTION) { - builder.setType(type.getCode()); convertedResources.forEach(builder::addCollectionEntry); } else { - builder.setType("transaction"); convertedResources.forEach(builder::addTransactionUpdateEntry); } IBaseBundle bundle = builder.getBundle(); From fb0e6ce8b2836c189de80b9c5d7ff41009351528 Mon Sep 17 00:00:00 2001 From: c-schuler Date: Tue, 25 Nov 2025 12:05:45 -0700 Subject: [PATCH 6/6] Improve ConvertR5toR4 CLI conversion tests and modernize implementation - Keeps the runtime behavior of ConvertR5toR4 intact. - Significantly strengthens the test suite by asserting that: - All CLI conversions produce R4 Bundles. - Entry counts match the number of source resources for both single and multiple inputs. - Error paths for invalid encoding and invalid directories are enforced. - Cleans up test code style and ensures no test artifacts persist on disk after execution. - Removed operations/convert/ConvertR5toR4 class --- .../cqf/tooling/operation/ConvertR5toR4.java | 49 ++-- .../operations/convert/ConvertR5toR4.java | 126 ---------- .../tooling/operation/ConvertR5toR4Test.java | 219 +++++++++++++----- 3 files changed, 187 insertions(+), 207 deletions(-) delete mode 100644 tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java index 6d152eecc..9618a114f 100644 --- a/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java +++ b/tooling/src/main/java/org/opencds/cqf/tooling/operation/ConvertR5toR4.java @@ -1,31 +1,24 @@ package org.opencds.cqf.tooling.operation; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.stream.Collectors; - -import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; -import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50; +import ca.uhn.fhir.model.valueset.BundleTypeEnum; +import ca.uhn.fhir.util.BundleBuilder; +import jakarta.annotation.Nonnull; import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseResource; - import org.opencds.cqf.tooling.Operation; import org.opencds.cqf.tooling.utilities.BundleUtils; import org.opencds.cqf.tooling.utilities.FhirContextCache; import org.opencds.cqf.tooling.utilities.IOUtils; import org.opencds.cqf.tooling.utilities.converters.ResourceAndTypeConverter; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.model.valueset.BundleTypeEnum; -import ca.uhn.fhir.util.BundleBuilder; -import jakarta.annotation.Nonnull; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.stream.Collectors; + public class ConvertR5toR4 extends Operation { public static final List ALLOWED_BUNDLE_TYPES = List.of( @@ -61,12 +54,12 @@ public static List allowedBundleTypes() { private void extractOptionsFromArgs(String[] args) { for (String arg : args) { if (arg.equals("-ConvertR5toR4")) continue; - String[] flagAndValue = arg.split("="); + var flagAndValue = arg.split("="); if (flagAndValue.length < 2) { throw new IllegalArgumentException("Invalid argument: " + arg); } - String flag = flagAndValue[0]; - String value = flagAndValue[1]; + var flag = flagAndValue[0]; + var value = flagAndValue[1]; switch (flag.replace("-", "").toLowerCase()) { case "bundleid": @@ -123,12 +116,12 @@ private void validatePathToDirectory() { throw new IllegalArgumentException(String.format("The path [%s] to the resource directory is required", pathToDirectory)); } - File resourceDirectory = new File(pathToDirectory); + var resourceDirectory = new File(pathToDirectory); if (!resourceDirectory.isDirectory()) { throw new RuntimeException(String.format("The specified path [%s] to resource files is not a directory", pathToDirectory)); } - File[] resources = resourceDirectory.listFiles(); + var resources = resourceDirectory.listFiles(); if (resources == null || resources.length == 0) { throw new RuntimeException(String.format("The specified path [%s] to resource files is empty", pathToDirectory)); } @@ -143,12 +136,12 @@ public void execute(String[] args) { validatePathToDirectory(); validateBundleType(); - BundleTypeEnum bundleType = BundleUtils.getBundleType(this.bundleType); + var bundleType = BundleUtils.getBundleType(this.bundleType); if (bundleType == null) { logger.error("Invalid bundle type: {}", this.bundleType); } else { - IBaseBundle bundle = convertResources( + var bundle = convertResources( bundleId, bundleType, IOUtils.readResources( @@ -167,22 +160,22 @@ public void execute(String[] args) { private IBaseBundle convertResources(String bundleId, BundleTypeEnum type, @Nonnull List resourcesToConvert) { - List convertedResources = new ArrayList<>(); - for (IBaseResource resource: resourcesToConvert){ + var convertedResources = new ArrayList(); + for (var resource : resourcesToConvert){ if (resource instanceof org.hl7.fhir.r5.model.Resource) { convertedResources.add(ResourceAndTypeConverter.r5ToR4Resource(resource)); } } - FhirContext context = FhirContextCache.getContext("r4"); - BundleBuilder builder = new BundleBuilder(context); + var context = FhirContextCache.getContext("r4"); + var builder = new BundleBuilder(context); if (type == BundleTypeEnum.COLLECTION) { convertedResources.forEach(builder::addCollectionEntry); } else { convertedResources.forEach(builder::addTransactionUpdateEntry); } - IBaseBundle bundle = builder.getBundle(); + var bundle = builder.getBundle(); bundle.setId(bundleId == null ? UUID.randomUUID().toString() : bundleId); return bundle; } diff --git a/tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java b/tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java deleted file mode 100644 index b9262e138..000000000 --- a/tooling/src/main/java/org/opencds/cqf/tooling/operations/convert/ConvertR5toR4.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.opencds.cqf.tooling.operations.convert; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; -import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50; -import org.hl7.fhir.instance.model.api.IBaseBundle; -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.opencds.cqf.tooling.operations.ExecutableOperation; -import org.opencds.cqf.tooling.operations.Operation; -import org.opencds.cqf.tooling.operations.OperationParam; -import org.opencds.cqf.tooling.utilities.BundleUtils; -import org.opencds.cqf.tooling.utilities.FhirContextCache; -import org.opencds.cqf.tooling.utilities.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.model.valueset.BundleTypeEnum; -import ca.uhn.fhir.util.BundleBuilder; -import jakarta.annotation.Nonnull; - -@Operation(name = "ConvertR5toR4") -public class ConvertR5toR4 implements ExecutableOperation { - - private static final Logger logger = LoggerFactory.getLogger(ConvertR5toR4.class); - @OperationParam(alias = { "ptr", "pathtoresources" }, setter = "setPathToResources", required = true, - description = "Path to the directory containing the resource files to be consolidated into the new bundle (required)") - private String pathToResources; - @OperationParam(alias = { "e", "encoding" }, setter = "setEncoding", defaultValue = "json", - description = "The file format to be used for representing the resulting Bundle { json, xml } (default json)") - private String encoding; - @OperationParam(alias = { "t", "type" }, setter = "setType", defaultValue = "transaction", - description = "The Bundle type as defined in the FHIR specification for the Bundle.type element (default transaction)") - private String type; - @OperationParam(alias = { "bid", "bundleid" }, setter = "setBundleId", - description = "A valid FHIR ID to be used as the ID for the resulting FHIR Bundle (optional)") - private String bundleId; - @OperationParam(alias = { "op", "outputPath" }, setter = "setOutputPath", - defaultValue = "src/main/resources/org/opencds/cqf/tooling/convertR5toR4/output", - description = "The directory path to which the generated Bundle file should be written (default src/main/resources/org/opencds/cqf/tooling/convertR5toR4/output)") - private String outputPath; - - @Override - public void execute() { - FhirContext context = FhirContextCache.getContext("r5"); - BundleTypeEnum bundleType = BundleUtils.getBundleType(type); - if (bundleType == null) { - logger.error("Invalid bundle type: {}", type); - } - else { - IBaseBundle bundle = convertResources(context, bundleId, bundleType, - IOUtils.readResources(IOUtils.getFilePaths(pathToResources, true), context)); - IOUtils.writeResource(bundle, outputPath == null ? pathToResources : outputPath, - IOUtils.Encoding.parse(encoding), context); - } - } - - public static IBaseBundle convertResources(@Nonnull FhirContext fhirContext, - String bundleId, BundleTypeEnum type, - @Nonnull List resourcesToConvert) { - VersionConvertor_40_50 versionConverter4050 = new VersionConvertor_40_50(new BaseAdvisor_40_50(true)); - - List convertedResources = new ArrayList<>(); - for (IBaseResource resource: resourcesToConvert){ - if (resource instanceof org.hl7.fhir.r5.model.Resource) { - convertedResources.add(versionConverter4050.convertResource((org.hl7.fhir.r5.model.Resource)resourcesToConvert)); - } - } - - BundleBuilder builder = new BundleBuilder(fhirContext); - if (type == BundleTypeEnum.COLLECTION) { - builder.setType(type.getCode()); - convertedResources.forEach(builder::addCollectionEntry); - } - else { - builder.setType("transaction"); - convertedResources.forEach(builder::addTransactionUpdateEntry); - } - IBaseBundle bundle = builder.getBundle(); - bundle.setId(bundleId == null ? UUID.randomUUID().toString() : bundleId); - return bundle; - } - - public String getPathToResources() { - return pathToResources; - } - - public void setPathToResources(String pathToResources) { - this.pathToResources = pathToResources; - } - - public String getEncoding() { - return encoding; - } - - public void setEncoding(String encoding) { - this.encoding = encoding; - } - - public String getBundleId() { - return bundleId; - } - - public void setBundleId(String bundleId) { - this.bundleId = bundleId; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getOutputPath() { - return outputPath; - } - - public void setOutputPath(String outputDirectory) { - this.outputPath = outputDirectory; - } -} diff --git a/tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java b/tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java index 113e87db8..192213ca1 100644 --- a/tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java +++ b/tooling/src/test/java/org/opencds/cqf/tooling/operation/ConvertR5toR4Test.java @@ -1,14 +1,14 @@ package org.opencds.cqf.tooling.operation; +import ca.uhn.fhir.context.FhirContext; +import org.hl7.fhir.r4.model.Bundle; +import org.opencds.cqf.tooling.utilities.IOUtils; import org.testng.Assert; import org.testng.annotations.Test; import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.stream.Stream; public class ConvertR5toR4Test { @@ -16,103 +16,216 @@ public class ConvertR5toR4Test { private final String OUTPUT_FILENAME_ARGUMENT = "-ofn="; private final String OUTPUT_PATH_ARGUMENT = "-op="; private final String PATH_TO_DIRECTORY_ARGUMENT = "-ptd="; - private final String TYPE_ARGUMENT = "-t="; - private static String GetFullPath(String relativePath) { + private static String getFullPath(String relativePath) { return System.getProperty("user.dir") + File.separator + relativePath; } - private void ClearDirectory(String directoryPath){ - try (Stream stream = Files.walk(Paths.get(directoryPath))) { - stream.filter(Files::isRegularFile) // Filter for regular files only - .forEach(file -> { - try { - Files.delete(file); - } catch (IOException e) { - System.err.println("Failed to delete file: " + file + " - " + e.getMessage()); - } - }); + private Bundle parseR4BundleFromFile(File bundleFile) { + try { + var bundleJson = Files.readString(bundleFile.toPath()); + var r4Context = FhirContext.forR4(); + var parsed = r4Context.newJsonParser().parseResource(bundleJson); + + Assert.assertTrue(parsed instanceof Bundle, + "Output resource should be an R4 Bundle."); + + return (Bundle) parsed; } catch (IOException e) { - System.err.println("Error walking directory: " + e.getMessage()); + Assert.fail("Failed to read or parse converted bundle: " + e.getMessage()); + return null; // unreachable, but required by compiler } } - private void ConvertSingleResource(String sourceDirectory, String outputPath, String outputFile) { - String[] args = new String[5]; + private void convertSingleResource(String sourceDirectory, String outputPath, String outputFile) { + var args = new String[5]; args[0] = "-ConvertR5toR4"; args[1] = PATH_TO_DIRECTORY_ARGUMENT + sourceDirectory; - args[2] = ENCODING_ARGUMENT+ "json"; + args[2] = ENCODING_ARGUMENT + "json"; args[3] = OUTPUT_PATH_ARGUMENT + outputPath; args[4] = OUTPUT_FILENAME_ARGUMENT + outputFile; - ClearDirectory(outputPath); - ConvertR5toR4 converter = new ConvertR5toR4(); - converter.execute(args); - - File resultDir = new File(outputPath); - File[] actualFiles = resultDir.listFiles((dir, name) -> name.endsWith(".json")); - Assert.assertNotNull(actualFiles, "Conversion folder should not be null."); - Assert.assertEquals(actualFiles.length,1, "Conversion folder should only have a single file."); + IOUtils.initializeDirectory(outputPath); + var converter = new ConvertR5toR4(); + try { + converter.execute(args); + + var resultDir = new File(outputPath); + var actualFiles = resultDir.listFiles((dir, name) -> name.endsWith(".json")); + Assert.assertNotNull(actualFiles, "Conversion folder should not be null."); + Assert.assertEquals(actualFiles.length, 1, "Conversion folder should only have a single file."); + var expectedFileName = outputFile + ".json"; + Assert.assertEquals(actualFiles[0].getName(), expectedFileName, + "Converted file name should match the expected output file name."); + + var bundle = parseR4BundleFromFile(actualFiles[0]); + Assert.assertNotNull(bundle); + Assert.assertEquals(bundle.getEntry().size(), 1, + "Bundle should contain a single entry for a single source resource."); + } finally { + try { + IOUtils.deleteDirectory(outputPath); + } catch (IOException e) { + Assert.fail("Failed to delete output directory: " + e.getMessage()); + } + } } - private void ConvertMulitpleResources(String sourceDirectory, String outputPath) { - String[] args = new String[4]; + private void convertMultipleResources(String sourceDirectory, String outputPath) { + var args = new String[4]; args[0] = "-ConvertR5toR4"; args[1] = PATH_TO_DIRECTORY_ARGUMENT + sourceDirectory; - args[2] = ENCODING_ARGUMENT+ "json"; + args[2] = ENCODING_ARGUMENT + "json"; args[3] = OUTPUT_PATH_ARGUMENT + outputPath; - ClearDirectory(outputPath); - ConvertR5toR4 converter = new ConvertR5toR4(); - converter.execute(args); - - File resultDir = new File(outputPath); - File[] actualFiles = resultDir.listFiles((dir, name) -> name.endsWith(".json")); - Assert.assertNotNull(actualFiles, "Conversion folder should not be null."); - //Assert.assertEquals(actualFiles.length,1, "Conversion folder should only have a single file."); + IOUtils.initializeDirectory(outputPath); + var converter = new ConvertR5toR4(); + try { + converter.execute(args); + + var sourceDir = new File(sourceDirectory); + var sourceFiles = sourceDir.listFiles((dir, name) -> name.endsWith(".json")); + var expectedCount = sourceFiles == null ? 0 : sourceFiles.length; + + var resultDir = new File(outputPath); + var actualFiles = resultDir.listFiles((dir, name) -> name.endsWith(".json")); + Assert.assertNotNull(actualFiles, "Conversion folder should not be null."); + Assert.assertEquals(actualFiles.length, 1, + "Conversion should produce a single R4 bundle file."); + + var bundleFile = actualFiles[0]; + var bundle = parseR4BundleFromFile(bundleFile); + Assert.assertNotNull(bundle); + Assert.assertEquals(bundle.getEntry().size(), expectedCount, + "Bundle should contain one entry per source resource."); + } finally { + try { + IOUtils.deleteDirectory(outputPath); + } catch (IOException e) { + Assert.fail("Failed to delete output directory: " + e.getMessage()); + } + } } @Test public void testExecute_ConvertSingleResourceCodeSystem() { - ConvertSingleResource( - GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system"), - GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/code-system"), + convertSingleResource( + getFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system"), + getFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/code-system"), "r4-code-system-action-code" ); } @Test public void testExecute_ConvertSingleResourceConceptMap() { - ConvertSingleResource( - GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/concept-map"), - GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/concept-map"), + convertSingleResource( + getFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/concept-map"), + getFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/concept-map"), "r4-concept-map-observation-status" ); } @Test public void testExecute_ConvertSingleResourceStructuredDefinition() { - ConvertSingleResource( - GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/structured-definition"), - GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/structured-definition"), + convertSingleResource( + getFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/structured-definition"), + getFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/structured-definition"), "r4-structured-definition-code" ); } @Test public void testExecute_ConvertSingleResourceValueset() { - ConvertSingleResource( - GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/valueset"), - GetFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/valueset"), + convertSingleResource( + getFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/valueset"), + getFullPath("target/test-output/convertR5toR4SingleResourceResults/single-resource/valueset"), "r4-valueset-event-status" ); } @Test public void testExecute_ConvertMultipleResources() { - ConvertMulitpleResources( - GetFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources"), - GetFullPath("target/test-output/convertR5toR4SingleResourceResults/multiple-resources") + convertMultipleResources( + getFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/multiple-resources"), + getFullPath("target/test-output/convertR5toR4SingleResourceResults/multiple-resources") ); } + + @Test + public void testExecute_R5BundleConvertedToR4BundleWithR4Entries() { + var inputDir = getFullPath("target/test-output/convertR5toR4SingleResourceResults/r5-bundle-input"); + var outputDir = getFullPath("target/test-output/convertR5toR4SingleResourceResults/r5-bundle-output"); + + IOUtils.initializeDirectory(inputDir); + IOUtils.initializeDirectory(outputDir); + + try { + // Build an R5 Bundle with a Patient and an Observation entry + var r5Bundle = new org.hl7.fhir.r5.model.Bundle(); + r5Bundle.setType(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION); + + var r5Patient = new org.hl7.fhir.r5.model.Patient(); + r5Patient.setId("patient-1"); + r5Bundle.addEntry().setResource(r5Patient); + + var r5Observation = new org.hl7.fhir.r5.model.Observation(); + r5Observation.setId("observation-1"); + r5Bundle.addEntry().setResource(r5Observation); + + // Write the R5 Bundle as a JSON file into the input directory + var r5Context = FhirContext.forR5(); + var r5Json = r5Context.newJsonParser().encodeResourceToString(r5Bundle); + var inputFile = new File(inputDir, "r5-bundle.json"); + Files.writeString(inputFile.toPath(), r5Json); + + // Reuse convertSingleResource (using "r5-bundle" as the output file name) + convertSingleResource(inputDir, outputDir, "r5-bundle"); + } catch (IOException e) { + Assert.fail("Failed to write R5 bundle input file: " + e.getMessage()); + } finally { + try { + IOUtils.deleteDirectory(inputDir); + } catch (IOException e) { + Assert.fail("Failed to delete input directory: " + e.getMessage()); + } + } + } + + @Test(expectedExceptions = Exception.class) + public void testExecute_InvalidEncodingThrowsException() { + var sourceDirectory = getFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/single-resource/code-system"); + var outputDirectory = getFullPath("target/test-output/convertR5toR4SingleResourceResults/invalid-encoding"); + + IOUtils.initializeDirectory(outputDirectory); + + var args = new String[4]; + args[0] = "-ConvertR5toR4"; + args[1] = PATH_TO_DIRECTORY_ARGUMENT + sourceDirectory; + args[2] = ENCODING_ARGUMENT + "invalid-encoding"; + args[3] = OUTPUT_PATH_ARGUMENT + outputDirectory; + + try { + var converter = new ConvertR5toR4(); + converter.execute(args); + } finally { + try { + IOUtils.deleteDirectory(outputDirectory); + } catch (IOException e) { + Assert.fail("Failed to delete output directory: " + e.getMessage()); + } + } + } + + @Test(expectedExceptions = Exception.class) + public void testExecute_InvalidPathToDirectoryThrowsException() { + var invalidDirectory = getFullPath("src/test/resources/org/opencds/cqf/tooling/operation/convertR5toR4/does-not-exist"); + + var args = new String[3]; + args[0] = "-ConvertR5toR4"; + args[1] = PATH_TO_DIRECTORY_ARGUMENT + invalidDirectory; + args[2] = ENCODING_ARGUMENT + "json"; + + var converter = new ConvertR5toR4(); + converter.execute(args); + } } \ No newline at end of file