NGS IG
0.1.0 - ci-build

NGS IG - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Resource Profile: DocumentReferenceTWNGS - Mappings

Draft as of 2025-01-13

Mappings for the DocumentReference-twngs resource profile.

Mappings for Workflow Pattern (http://hl7.org/fhir/workflow)

DocumentReferenceTWNGS
DocumentReferenceEvent
   masterIdentifierEvent.identifier
   identifierEvent.identifier
   statusEvent.status
   typeEvent.code
   subjectEvent.subject
   dateEvent.occurrence[x]
   authorEvent.performer.actor
   authenticatorEvent.performer.actor
   custodianEvent.performer.actor
   context
      encounterEvent.context

Mappings for FHIR Composition (http://hl7.org/fhir/composition)

DocumentReferenceTWNGS
DocumentReferencewhen describing a Composition
   masterIdentifierComposition.identifier
   docStatusComposition.status
   typeComposition.type
   categoryComposition.class
   subjectComposition.subject
   dateComposition.date
   authorComposition.author
   authenticatorComposition.attester
   custodianComposition.custodian
   relatesToComposition.relatesTo
      codeComposition.relatesTo.code
      targetComposition.relatesTo.target
   securityLabelComposition.confidentiality, Composition.meta.security
   contentBundle(Composition+*)
      attachmentComposition.language, Composition.title, Composition.date
      formatComposition.meta.profile
   context
      encounterComposition.encounter
      eventComposition.event.code
      periodComposition.event.period
      facilityTypeusually from a mapping to a local ValueSet
      practiceSettingusually from a mapping to a local ValueSet
      sourcePatientInfoComposition.subject
      relatedComposition.event.detail

Mappings for RIM Mapping (http://hl7.org/v3)

DocumentReferenceTWNGS
DocumentReferenceEntity. Role, or Act, Document[classCode="DOC" and moodCode="EVN"]
   metan/a, N/A
   implicitRulesn/a
   languagen/a
   textn/a, N/A, Act.text?
   containedEntity. Role, or Act, N/A
   extensionn/a, N/A
   modifierExtensionn/a, N/A
   masterIdentifiern/a, II - The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs. Also maps to Role[classCode=IDENT], .id
   identifiern/a, II - The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs. Also maps to Role[classCode=IDENT], .id / .setId
   statusn/a, interim: .completionCode="IN" & ./statusCode[isNormalDatatype()]="active"; final: .completionCode="AU" && ./statusCode[isNormalDatatype()]="complete" and not(./inboundRelationship[typeCode="SUBJ" and isNormalActRelationship()]/source[subsumesCode("ActClass#CACT") and moodCode="EVN" and domainMember("ReviseDocument", code) and isNormalAct()]); amended: .completionCode="AU" && ./statusCode[isNormalDatatype()]="complete" and ./inboundRelationship[typeCode="SUBJ" and isNormalActRelationship()]/source[subsumesCode("ActClass#CACT") and moodCode="EVN" and domainMember("ReviseDocument", code) and isNormalAct() and statusCode="completed"]; withdrawn : .completionCode=NI && ./statusCode[isNormalDatatype()]="obsolete"
   docStatusn/a, .statusCode
   typen/a, CD, ./code
      idn/a
      extensionn/a, N/A
      codingn/a, CV, union(., ./translation)
         idn/a
         extensionn/a, N/A
         systemn/a, ./codeSystem
         versionn/a, ./codeSystemVersion
         coden/a, ./code
         displayn/a, CV.displayName
         userSelectedn/a, CD.codingRationale
      textn/a, ./originalText[mediaType/code="text/plain"]/data
   categoryn/a, CD, .outboundRelationship[typeCode="COMP].target[classCode="LIST", moodCode="EVN"].code
      idn/a
      extensionn/a, N/A
      codingn/a, CV, union(., ./translation)
         idn/a
         extensionn/a, N/A
         systemn/a, ./codeSystem
         versionn/a, ./codeSystemVersion
         coden/a, ./code
         displayn/a, CV.displayName
         userSelectedn/a, CD.codingRationale
      textn/a, ./originalText[mediaType/code="text/plain"]/data
   subjectn/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), .participation[typeCode="SBJ"].role[typeCode="PAT"]
   daten/a, .availabilityTime[type="TS"]
   authorn/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), .participation[typeCode="AUT"].role[classCode="ASSIGNED"]
   authenticatorn/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), .participation[typeCode="AUTHEN"].role[classCode="ASSIGNED"]
   custodiann/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), .participation[typeCode="RCV"].role[classCode="CUST"].scoper[classCode="ORG" and determinerCode="INST"]
   relatesTon/a, .outboundRelationship
      idn/a
      extensionn/a, N/A
      modifierExtensionn/a, N/A
      coden/a, .outboundRelationship.typeCode
      targetn/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), .target[classCode="DOC", moodCode="EVN"].id
   descriptionn/a, .outboundRelationship[typeCode="SUBJ"].target.text
   securityLabeln/a, CD, .confidentialityCode
      idn/a
      extensionn/a, N/A
      codingn/a, CV, union(., ./translation)
         idn/a
         extensionn/a, N/A
         systemn/a, ./codeSystem
         versionn/a, ./codeSystemVersion
         coden/a, ./code
         displayn/a, CV.displayName
         userSelectedn/a, CD.codingRationale
      textn/a, ./originalText[mediaType/code="text/plain"]/data
   contentn/a, document.text
      idn/a
      extensionn/a, N/A
      modifierExtensionn/a, N/A
      attachmentn/a, ED, document.text
         idn/a
         extensionn/a, N/A
         contentTypen/a, ./mediaType, ./charset
         languagen/a, ./language
         datan/a, ./data
         urln/a, ./reference/literal
         sizen/a, N/A (needs data type R3 proposal)
         hashn/a, .integrityCheck[parent::ED/integrityCheckAlgorithm="SHA-1"]
         titlen/a, ./title/data
         creationn/a, N/A (needs data type R3 proposal)
      formatn/a, CV, document.text
   contextn/a, outboundRelationship[typeCode="SUBJ"].target[classCode<'ACT']
      idn/a
      extensionn/a, N/A
      modifierExtensionn/a, N/A
      encountern/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), unique(highest(./outboundRelationship[typeCode="SUBJ" and isNormalActRelationship()], priorityNumber)/target[moodCode="EVN" and classCode=("ENC", "PCPR") and isNormalAct])
      eventn/a, CD, .code
         idn/a
         extensionn/a, N/A
         codingn/a, CV, union(., ./translation)
            idn/a
            extensionn/a, N/A
            systemn/a, ./codeSystem
            versionn/a, ./codeSystemVersion
            coden/a, ./code
            displayn/a, CV.displayName
            userSelectedn/a, CD.codingRationale
         textn/a, ./originalText[mediaType/code="text/plain"]/data
      periodn/a, IVL<TS>[lowClosed="true" and highClosed="true"] or URG<TS>[lowClosed="true" and highClosed="true"], .effectiveTime
      facilityTypen/a, CD, .participation[typeCode="LOC"].role[classCode="DSDLOC"].code
      practiceSettingn/a, CD, .participation[typeCode="LOC"].role[classCode="DSDLOC"].code
         idn/a
         extensionn/a, N/A
         codingn/a, CV, union(., ./translation)
            idn/a
            extensionn/a, N/A
            systemn/a, ./codeSystem
            versionn/a, ./codeSystemVersion
            coden/a, ./code
            displayn/a, CV.displayName
            userSelectedn/a, CD.codingRationale
         textn/a, ./originalText[mediaType/code="text/plain"]/data
      sourcePatientInfon/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), .participation[typeCode="SBJ"].role[typeCode="PAT"]
      relatedn/a, The target of a resource reference is a RIM entry point (Act, Role, or Entity), ./outboundRelationship[typeCode="PERT" and isNormalActRelationship()] / target[isNormalAct]

Mappings for CDA (R2) (http://hl7.org/v3/cda)

DocumentReferenceTWNGS
DocumentReferencewhen describing a CDA
   masterIdentifierClinicalDocument/id
   typeClinicalDocument/code/@code The typeCode should be mapped from the ClinicalDocument/code element to a set of document type codes configured in the affinity domain. One suggested coding system to use for typeCode is LOINC, in which case the mapping step can be omitted.
   categoryDerived from a mapping of /ClinicalDocument/code/@code to an Affinity Domain specified coded value to use and coding system. Affinity Domains are encouraged to use the appropriate value for Type of Service, based on the LOINC Type of Service (see Page 53 of the LOINC User's Manual). Must be consistent with /ClinicalDocument/code/@code
   subjectClinicalDocument/recordTarget/
   authorClinicalDocument/author
   authenticatorClinicalDocument/legalAuthenticator
   securityLabelClinicalDocument/confidentialityCode/@code
   content
      attachmentClinicalDocument/languageCode, ClinicalDocument/title, ClinicalDocument/date
      formatderived from the IHE Profile or Implementation Guide templateID
   context
      periodClinicalDocument/documentationOf/ serviceEvent/effectiveTime/low/ @value --> ClinicalDocument/documentationOf/ serviceEvent/effectiveTime/high/ @value
      facilityTypeusually a mapping to a local ValueSet. Must be consistent with /clinicalDocument/code
      practiceSettingusually from a mapping to a local ValueSet
      sourcePatientInfoClinicalDocument/recordTarget/
      relatedClinicalDocument/relatedDocument

Mappings for FiveWs Pattern Mapping (http://hl7.org/fhir/fivews)

DocumentReferenceTWNGS
DocumentReference
   masterIdentifierFiveWs.identifier
   identifierFiveWs.identifier
   statusFiveWs.status
   docStatusFiveWs.status
   typeFiveWs.class
   categoryFiveWs.class
   subjectFiveWs.subject[x], FiveWs.subject
   dateFiveWs.recorded
   authenticatorFiveWs.witness
   context
      encounterFiveWs.context

Mappings for HL7 v2 Mapping (http://hl7.org/v2)

DocumentReferenceTWNGS
DocumentReference
   masterIdentifierCX / EI (occasionally, more often EI maps to a resource id or a URL), TXA-12
   identifierCX / EI (occasionally, more often EI maps to a resource id or a URL), TXA-16?
   statusTXA-19
   docStatusTXA-17
   typeCE/CNE/CWE, TXA-2
      codingCE/CNE/CWE subset one of the sets of component 1-3 or 4-6, C*E.1-8, C*E.10-22
         systemC*E.3
         versionC*E.7
         codeC*E.1
         displayC*E.2 - but note this is not well followed
         userSelectedSometimes implied by being first
      textC*E.9. But note many systems use C*E.2 for this
   categoryCE/CNE/CWE
      codingCE/CNE/CWE subset one of the sets of component 1-3 or 4-6, C*E.1-8, C*E.10-22
         systemC*E.3
         versionC*E.7
         codeC*E.1
         displayC*E.2 - but note this is not well followed
         userSelectedSometimes implied by being first
      textC*E.9. But note many systems use C*E.2 for this
   subjectPID-3 (No standard way to define a Practitioner or Group subject in HL7 v2 MDM message)
   authorTXA-9 (No standard way to indicate a Device in HL7 v2 MDM message)
   authenticatorTXA-10
   descriptionTXA-25
   securityLabelCE/CNE/CWE, TXA-18
      codingCE/CNE/CWE subset one of the sets of component 1-3 or 4-6, C*E.1-8, C*E.10-22
         systemC*E.3
         versionC*E.7
         codeC*E.1
         displayC*E.2 - but note this is not well followed
         userSelectedSometimes implied by being first
      textC*E.9. But note many systems use C*E.2 for this
   content
      attachmentED/RP, TXA-3 for mime type
         contentTypeED.2+ED.3/RP.2+RP.3. Note conversion may be needed if old style values are being used
         dataED.5
         urlRP.1+RP.2 - if they refer to a URL (see v2.6)
      formatCE/CNE/CWE subset one of the sets of component 1-3 or 4-6
   context
      eventCE/CNE/CWE
         codingCE/CNE/CWE subset one of the sets of component 1-3 or 4-6, C*E.1-8, C*E.10-22
            systemC*E.3
            versionC*E.7
            codeC*E.1
            displayC*E.2 - but note this is not well followed
            userSelectedSometimes implied by being first
         textC*E.9. But note many systems use C*E.2 for this
      periodDR
      facilityTypeCE/CNE/CWE
      practiceSettingCE/CNE/CWE
         codingCE/CNE/CWE subset one of the sets of component 1-3 or 4-6, C*E.1-8, C*E.10-22
            systemC*E.3
            versionC*E.7
            codeC*E.1
            displayC*E.2 - but note this is not well followed
            userSelectedSometimes implied by being first
         textC*E.9. But note many systems use C*E.2 for this

Mappings for XDS metadata equivalent (http://ihe.net/xds)

DocumentReferenceTWNGS
DocumentReference
   masterIdentifierDocumentEntry.uniqueId
   identifierDocumentEntry.entryUUID
   statusDocumentEntry.availabilityStatus
   typeDocumentEntry.type
   categoryDocumentEntry.class
   subjectDocumentEntry.patientId
   authorDocumentEntry.author
   authenticatorDocumentEntry.legalAuthenticator
   relatesToDocumentEntry Associations
      codeDocumentEntry Associations type
      targetDocumentEntry Associations reference
   descriptionDocumentEntry.comments
   securityLabelDocumentEntry.confidentialityCode
   content
      attachmentDocumentEntry.mimeType, DocumentEntry.languageCode, DocumentEntry.URI, DocumentEntry.size, DocumentEntry.hash, DocumentEntry.title, DocumentEntry.creationTime
      formatDocumentEntry.formatCode
   context
      eventDocumentEntry.eventCodeList
      periodDocumentEntry.serviceStartTime, DocumentEntry.serviceStopTime
      facilityTypeDocumentEntry.healthcareFacilityTypeCode
      practiceSettingDocumentEntry.practiceSettingCode
      sourcePatientInfoDocumentEntry.sourcePatientInfo, DocumentEntry.sourcePatientId
      relatedDocumentEntry.referenceIdList