diff --git a/FHIR-us-ccda.xml b/FHIR-us-ccda.xml index 5d8b9b1..a15875e 100644 --- a/FHIR-us-ccda.xml +++ b/FHIR-us-ccda.xml @@ -26,6 +26,7 @@ + @@ -160,19 +161,29 @@ + + + + + + + + + + diff --git a/_gencontinuous.bat b/_gencontinuous.bat new file mode 100644 index 0000000..ca2867a --- /dev/null +++ b/_gencontinuous.bat @@ -0,0 +1,2 @@ +@ECHO OFF +CALL ./_genonce.bat -watch \ No newline at end of file diff --git a/_gencontinuous.sh b/_gencontinuous.sh new file mode 100644 index 0000000..b9ac593 --- /dev/null +++ b/_gencontinuous.sh @@ -0,0 +1,2 @@ +#!/bin/bash +./_genonce.sh -watch diff --git a/_genonce.sh b/_genonce.sh index 38efcb4..4f981f0 100755 --- a/_genonce.sh +++ b/_genonce.sh @@ -14,6 +14,8 @@ fi echo "$txoption" +export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -Dfile.encoding=UTF-8" + publisher=$input_cache_path/$publisher_jar if test -f "$publisher"; then java -jar $publisher -ig . $txoption $* diff --git a/_updatePublisher.bat b/_updatePublisher.bat new file mode 100644 index 0000000..67aebf5 --- /dev/null +++ b/_updatePublisher.bat @@ -0,0 +1,219 @@ +@ECHO OFF + +SETLOCAL + +SET dlurl=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar +SET publisher_jar=publisher.jar +SET input_cache_path=%CD%\input-cache\ +SET skipPrompts=false + +SET scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main +SET update_bat_url=%scriptdlroot%/_updatePublisher.bat +SET gen_bat_url=%scriptdlroot%/_genonce.bat +SET gencont_bat_url=%scriptdlroot%/_gencontinuous.bat +SET gencont_sh_url=%scriptdlroot%/_gencontinuous.sh +SET gen_sh_url=%scriptdlroot%/_genonce.sh +SET update_sh_url=%scriptdlroot%/_updatePublisher.sh + +IF "%~1"=="/f" SET skipPrompts=y + + +ECHO. +ECHO Checking internet connection... +PING tx.fhir.org -4 -n 1 -w 1000 | FINDSTR TTL && GOTO isonline +ECHO We're offline, nothing to do... +GOTO end + +:isonline +ECHO We're online + + +:processflags +SET ARG=%1 +IF DEFINED ARG ( + IF "%ARG%"=="-f" SET FORCE=true + IF "%ARG%"=="--force" SET FORCE=true + SHIFT + GOTO processflags +) + +FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx + +ECHO. +IF NOT EXIST "%input_cache_path%%publisher_jar%" ( + IF NOT EXIST "%upper_path%%publisher_jar%" ( + SET jarlocation="%input_cache_path%%publisher_jar%" + SET jarlocationname=Input Cache + ECHO IG Publisher is not yet in input-cache or parent folder. + REM we don't use jarlocation below because it will be empty because we're in a bracketed if statement + GOTO create + ) ELSE ( + ECHO IG Publisher FOUND in parent folder + SET jarlocation="%upper_path%%publisher_jar%" + SET jarlocationname=Parent folder + GOTO upgrade + ) +) ELSE ( + ECHO IG Publisher FOUND in input-cache + SET jarlocation="%input_cache_path%%publisher_jar%" + SET jarlocationname=Input Cache + GOTO upgrade +) + +:create +IF DEFINED FORCE ( + MKDIR "%input_cache_path%" 2> NUL + GOTO download +) + +IF "%skipPrompts%"=="y" ( + SET create=Y +) ELSE ( + SET /p create="Ok? (Y/N) " +) +IF /I "%create%"=="Y" ( + ECHO Will place publisher jar here: %input_cache_path%%publisher_jar% + MKDIR "%input_cache_path%" 2> NUL + GOTO download +) +GOTO done + +:upgrade +IF "%skipPrompts%"=="y" ( + SET overwrite=Y +) ELSE ( + SET /p overwrite="Overwrite %jarlocation%? (Y/N) " +) + +IF /I "%overwrite%"=="Y" ( + GOTO download +) +GOTO done + +:download +ECHO Downloading most recent publisher to %jarlocationname% - it's ~100 MB, so this may take a bit + +FOR /f "tokens=4-5 delims=. " %%i IN ('ver') DO SET VERSION=%%i.%%j +IF "%version%" == "10.0" GOTO win10 +IF "%version%" == "6.3" GOTO win8.1 +IF "%version%" == "6.2" GOTO win8 +IF "%version%" == "6.1" GOTO win7 +IF "%version%" == "6.0" GOTO vista + +ECHO Unrecognized version: %version% +GOTO done + +:win10 +CALL POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%dlurl%\",\"%jarlocation%\") } else { Invoke-WebRequest -Uri "%dlurl%" -Outfile "%jarlocation%" } + +GOTO done + +:win7 +rem this may be triggering the antivirus - bitsadmin.exe is a known threat +rem CALL bitsadmin /transfer GetPublisher /download /priority normal "%dlurl%" "%jarlocation%" + +rem this didn't work in win 10 +rem CALL Start-BitsTransfer /priority normal "%dlurl%" "%jarlocation%" + +rem this should work - untested +call (New-Object Net.WebClient).DownloadFile('%dlurl%', '%jarlocation%') +GOTO done + +:win8.1 +:win8 +:vista +GOTO done + + + +:done + + + + +ECHO. +ECHO Updating scripts +IF "%skipPrompts%"=="y" ( + SET updateScripts=Y +) ELSE ( + SET /p updateScripts="Update scripts? (Y/N) " +) +IF /I "%updateScripts%"=="Y" ( + GOTO scripts +) +GOTO end + + +:scripts + +REM Download all batch files (and this one with a new name) + +SETLOCAL DisableDelayedExpansion + + + +:dl_script_1 +ECHO Updating _updatePublisher.sh +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%update_sh_url%\",\"_updatePublisher.new.sh\") } else { Invoke-WebRequest -Uri "%update_sh_url%" -Outfile "_updatePublisher.new.sh" } +if %ERRORLEVEL% == 0 goto upd_script_1 +echo "Errors encountered during download: %errorlevel%" +goto dl_script_2 +:upd_script_1 +start copy /y "_updatePublisher.new.sh" "_updatePublisher.sh" ^&^& del "_updatePublisher.new.sh" ^&^& exit + + +:dl_script_2 +ECHO Updating _genonce.bat +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gen_bat_url%\",\"_genonce.new.bat\") } else { Invoke-WebRequest -Uri "%gen_bat_url%" -Outfile "_genonce.bat" } +if %ERRORLEVEL% == 0 goto upd_script_2 +echo "Errors encountered during download: %errorlevel%" +goto dl_script_3 +:upd_script_2 +start copy /y "_genonce.new.bat" "_genonce.bat" ^&^& del "_genonce.new.bat" ^&^& exit + +:dl_script_3 +ECHO Updating _gencontinuous.bat +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gencont_bat_url%\",\"_gencontinuous.new.bat\") } else { Invoke-WebRequest -Uri "%gencont_bat_url%" -Outfile "_gencontinuous.bat" } +if %ERRORLEVEL% == 0 goto upd_script_3 +echo "Errors encountered during download: %errorlevel%" +goto dl_script_4 +:upd_script_3 +start copy /y "_gencontinuous.new.bat" "_gencontinuous.bat" ^&^& del "_gencontinuous.new.bat" ^&^& exit + + +:dl_script_4 +ECHO Updating _genonce.sh +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gen_sh_url%\",\"_genonce.new.sh\") } else { Invoke-WebRequest -Uri "%gen_sh_url%" -Outfile "_genonce.sh" } +if %ERRORLEVEL% == 0 goto upd_script_4 +echo "Errors encountered during download: %errorlevel%" +goto dl_script_5 +:upd_script_4 +start copy /y "_genonce.new.sh" "_genonce.sh" ^&^& del "_genonce.new.sh" ^&^& exit + +:dl_script_5 +ECHO Updating _gencontinuous.sh +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%gencont_sh_url%\",\"_gencontinuous.new.sh\") } else { Invoke-WebRequest -Uri "%gencont_sh_url%" -Outfile "_gencontinuous.sh" } +if %ERRORLEVEL% == 0 goto upd_script_5 +echo "Errors encountered during download: %errorlevel%" +goto dl_script_6 +:upd_script_5 +start copy /y "_gencontinuous.new.sh" "_gencontinuous.sh" ^&^& del "_gencontinuous.new.sh" ^&^& exit + + + +:dl_script_6 +ECHO Updating _updatePublisher.bat +call POWERSHELL -command if ('System.Net.WebClient' -as [type]) {(new-object System.Net.WebClient).DownloadFile(\"%update_bat_url%\",\"_updatePublisher.new.bat\") } else { Invoke-WebRequest -Uri "%update_bat_url%" -Outfile "_updatePublisher.new.bat" } +if %ERRORLEVEL% == 0 goto upd_script_6 +echo "Errors encountered during download: %errorlevel%" +goto end +:upd_script_6 +start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updatePublisher.new.bat" ^&^& exit + + +:end + + +IF "%skipPrompts%"=="true" ( + PAUSE +) diff --git a/_updatePublisher.sh b/_updatePublisher.sh index a817ce3..0f9ecbe 100755 --- a/_updatePublisher.sh +++ b/_updatePublisher.sh @@ -25,18 +25,13 @@ while [ "$#" -gt 0 ]; do case $1 in -f|--force) FORCE=true ;; -y|--yes) skipPrompts=true ; FORCE=true ;; - -s|--skip) skipPrompts=true ;; *) echo "Unknown parameter passed: $1. Exiting"; exit 1 ;; esac shift done echo "Checking internet connection" -case "$OSTYPE" in - linux-gnu* ) ping tx.fhir.org -4 -c 1 -w 1000 >/dev/null ;; - darwin* ) ping tx.fhir.org -c 1 >/dev/null ;; - *) echo "unknown: $OSTYPE"; exit 1 ;; -esac +curl -sSf tx.fhir.org > /dev/null if [ $? -ne 0 ] ; then echo "Offline (or the terminology server is down), unable to update. Exiting" @@ -44,11 +39,11 @@ if [ $? -ne 0 ] ; then fi if [ ! -d "$input_cache_path" ] ; then - if [ $skipPrompts != true ]; then + if [ $FORCE != true ]; then echo "$input_cache_path does not exist" message="create it?" read -r -p "$message" response - else + else response=y fi fi @@ -90,14 +85,48 @@ if [[ $skipPrompts == false ]]; then fi read -r -p "$message" response else - if [[ $FORCE == true ]]; then - response=y - fi + response=y fi -if [[ $response =~ ^[yY].*$ ]]; then +if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit" curl -L $dlurl -o "$jarlocation" --create-dirs else echo cancelled publisher update fi + +if [[ $skipPrompts != true ]]; then + message="Update scripts? (enter 'y' or 'Y' to continue, any other key to cancel)?" + read -r -p "$message" response + fi + +if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then + echo "Downloading most recent scripts " + + curl -L $update_bat_url -o /tmp/_updatePublisher.new + cp /tmp/_updatePublisher.new _updatePublisher.bat + rm /tmp/_updatePublisher.new + + curl -L $gen_bat_url -o /tmp/_genonce.new + cp /tmp/_genonce.new _genonce.bat + rm /tmp/_genonce.new + + curl -L $gencont_bat_url -o /tmp/_gencontinuous.new + cp /tmp/_gencontinuous.new _gencontinuous.bat + rm /tmp/_gencontinuous.new + + curl -L $gencont_sh_url -o /tmp/_gencontinuous.new + cp /tmp/_gencontinuous.new _gencontinuous.sh + chmod +x _gencontinuous.sh + rm /tmp/_gencontinuous.new + + curl -L $gen_sh_url -o /tmp/_genonce.new + cp /tmp/_genonce.new _genonce.sh + chmod +x _genonce.sh + rm /tmp/_genonce.new + + curl -L $update_sh_url -o /tmp/_updatePublisher.new + cp /tmp/_updatePublisher.new _updatePublisher.sh + chmod +x _updatePublisher.sh + rm /tmp/_updatePublisher.new +fi diff --git a/input/hl7.fhir.us.ccda.xml b/input/hl7.fhir.us.ccda.xml index 15a5b42..6365bbe 100644 --- a/input/hl7.fhir.us.ccda.xml +++ b/input/hl7.fhir.us.ccda.xml @@ -817,91 +817,146 @@ <generation value="markdown"/> - </page> - <page> - <nameUrl value="mappingGuidance.html"/> - <title value="Mapping General and Structural Guidance"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="CF-index.html"/> - <title value="C-CDA → FHIR Index"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="FC-index.html"/> - <title value="FHIR → C-CDA Index"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="CF-patient.html"/> - <title value="C-CDA to FHIR Patient"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="CF-allergies.html"/> - <title value="C-CDA to FHIR Allergies"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="CF-immunizations.html"/> - <title value="C-CDA to FHIR Immunizations"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="CF-medications.html"/> - <title value="C-CDA to FHIR Medications"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="CF-problems.html"/> - <title value="C-CDA to FHIR Problems"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="CF-procedures.html"/> - <title value="C-CDA to FHIR Procedures"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="FC-patient.html"/> - <title value="FHIR to C-CDA Patient"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="FC-allergies.html"/> - <title value="FHIR to C-CDA Allergies"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="FC-immunizations.html"/> - <title value="FHIR to C-CDA Immunizations"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="FC-medications.html"/> - <title value="FHIR to C-CDA Medications"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="FC-problems.html"/> - <title value="FHIR to C-CDA Problems"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="FC-procedures.html"/> - <title value="FHIR to C-CDA Procedures"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="conceptMaps.html"/> - <title value="Terminology Maps (Concept Maps)"/> - <generation value="markdown"/> - </page> - <page> - <nameUrl value="mappingIssues.html"/> - <title value="Known Issues"/> - <generation value="markdown"/> + <page> + <nameUrl value="mappingGuidance.html"/> + <title value="Mapping General and Structural Guidance"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-index.html"/> + <title value="C-CDA → FHIR Index"/> + <generation value="markdown"/> + <page> + <nameUrl value="CF-patient.html"/> + <title value="C-CDA to FHIR Patient"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-participations.html"/> + <title value="C-CDA to FHIR Participations"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-allergies.html"/> + <title value="C-CDA to FHIR Allergies"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-encounters.html"/> + <title value="C-CDA to FHIR Encounters"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-immunizations.html"/> + <title value="C-CDA to FHIR Immunizations"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-medications.html"/> + <title value="C-CDA to FHIR Medications"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-notes.html"/> + <title value="C-CDA to FHIR Notes"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-problems.html"/> + <title value="C-CDA to FHIR Problems"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-procedures.html"/> + <title value="C-CDA to FHIR Procedures"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-results.html"/> + <title value="C-CDA to FHIR Results"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-social.html"/> + <title value="C-CDA to FHIR Social History"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="CF-vitals.html"/> + <title value="C-CDA to FHIR Vital Signs"/> + <generation value="markdown"/> + </page> + </page> + <page> + <nameUrl value="FC-index.html"/> + <title value="FHIR → C-CDA Index"/> + <generation value="markdown"/> + <page> + <nameUrl value="FC-patient.html"/> + <title value="FHIR to C-CDA Patient"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-allergies.html"/> + <title value="FHIR to C-CDA Allergies"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-encounters.html"/> + <title value="FHIR to C-CDA Encounters"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-immunizations.html"/> + <title value="FHIR to C-CDA Immunizations"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-medications.html"/> + <title value="FHIR to C-CDA Medications"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-notes.html"/> + <title value="FHIR to C-CDA Medications"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-problems.html"/> + <title value="FHIR to C-CDA Problems"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-procedures.html"/> + <title value="FHIR to C-CDA Procedures"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-results.html"/> + <title value="FHIR to C-CDA Results"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-social.html"/> + <title value="FHIR to C-CDA Social History"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="FC-vitals.html"/> + <title value="FHIR to C-CDA Vital Signs"/> + <generation value="markdown"/> + </page> + </page> + <page> + <nameUrl value="conceptMaps.html"/> + <title value="Terminology Maps (Concept Maps)"/> + <generation value="markdown"/> + </page> + <page> + <nameUrl value="mappingIssues.html"/> + <title value="Known Issues"/> + <generation value="markdown"/> + </page> </page> <page> <nameUrl value="the_specification.html"/> diff --git a/input/images/CF_VitalsHR_example.png b/input/images/CF_VitalsHR_example.png new file mode 100644 index 0000000..0f03531 Binary files /dev/null and b/input/images/CF_VitalsHR_example.png differ diff --git a/input/images/CF_smoking_example.png b/input/images/CF_smoking_example.png new file mode 100644 index 0000000..5fd6073 Binary files /dev/null and b/input/images/CF_smoking_example.png differ diff --git a/input/maps/ConceptMap-CF-EncounterStatus.json b/input/maps/ConceptMap-CF-EncounterStatus.json new file mode 100644 index 0000000..2fb3d56 --- /dev/null +++ b/input/maps/ConceptMap-CF-EncounterStatus.json @@ -0,0 +1,142 @@ +{ + "resourceType" : "ConceptMap", + "id" : "CF-EncounterStatus", + "extension" : [ + { + "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg", + "valueCode" : "cgp" + } + ], + "url" : "http://hl7.org/fhir/us/ccda/ConceptMap/CF-EncounterStatus", + "version" : "1.2.0", + "name" : "CCDAtoFHIREncounterStatus", + "title" : "C-CDA to FHIR Encounter Status", + "status" : "active", + "experimental" : false, + "date" : "2024-09-22T17:40:28+00:00", + "publisher" : "HL7 International / Cross-Group Projects", + "contact" : [ + { + "name" : "HL7 International / Cross-Group Projects", + "telecom" : [ + { + "system" : "url", + "value" : "http://www.hl7.org/Special/committees/cgp" + } + ] + } + ], + "description" : "C-CDA to FHIR Encounter Status", + "jurisdiction" : [ + { + "coding" : [ + { + "system" : "urn:iso:std:iso:3166", + "code" : "US" + } + ] + } + ], + "sourceUri" : "http://terminology.hl7.org/CodeSystem/v3-ActStatus", + "targetUri" : "http://hl7.org/fhir/encounter-status", + "group" : [ + { + "source" : "http://terminology.hl7.org/CodeSystem/v3-ActStatus", + "target" : "http://hl7.org/fhir/encounter-status", + "element" : [ + { + "code" : "aborted", + "display" : "Aborted", + "target" : [ + { + "code" : "unknown", + "display" : "Unknown", + "equivalence" : "wider", + "comment" : "Semantically this could be 'finished', but that might imply completion." + } + ] + }, + { + "code" : "active", + "display" : "Active", + "target" : [ + { + "code" : "in-progress", + "display" : "In-progress", + "equivalence" : "equal" + } + ] + }, + { + "code" : "cancelled", + "display" : "Cancelled", + "target" : [ + { + "code" : "cancelled", + "display" : "Cancelled", + "equivalence" : "equal" + } + ] + }, + { + "code" : "completed", + "display" : "Completed", + "target" : [ + { + "code" : "finished", + "display" : "Finished", + "equivalence" : "equal" + } + ] + }, + { + "code" : "held", + "display" : "Held", + "target" : [ + { + "code" : "planned", + "display" : "Planned", + "equivalence" : "wider", + "comment" : "Held encounters have been planned, but intent to execute has been suspended." + } + ] + }, + { + "code" : "new", + "display" : "New", + "target" : [ + { + "code" : "unknown", + "display" : "Unknown", + "equivalence" : "wider", + "comment" : "This is not Planned, because New encounters have been planned but may or may not have been started. 'Planned' encounters in FHIR have not been started." + } + ] + }, + { + "code" : "suspended", + "display" : "Suspended", + "target" : [ + { + "code" : "on-leave", + "display" : "On-leave", + "equivalence" : "narrower", + "comment" : "Suspended encounters have been started, but intent to execute has been temporarily stopped. On-leave is a special case of this circumstance." + } + ] + }, + { + "code" : "nullified", + "display" : "Nullified", + "target" : [ + { + "code" : "entered-in-error", + "display" : "Entered-in-error", + "equivalence" : "equal" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/input/pagecontent/CF-allergies.md b/input/pagecontent/CF-allergies.md index 7a44eab..d6c3930 100644 --- a/input/pagecontent/CF-allergies.md +++ b/input/pagecontent/CF-allergies.md @@ -7,7 +7,7 @@ td, th { This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, please refer to [Allergies FHIR → CDA](./FC-allergies.html). For guidance on how to read the table below, see [Reading the C-CDA ↔ FHIR Mapping Pages](./mappingGuidance.html) -**Uncommon use case:** Multiple C-CDA Allergy Intolerance observations inside a single Allery Concern act should map to separate and distinct FHIR AllergyIntolerance resources. The C-CDA Companion Guide ([see 5.2.7.1](https://www.hl7.org/implement/standards/product_brief.cfm?product_id=447)) actively discourages the practice of multiple osbervations insice a single act. It may occur, however, since Allergy Concern act allows for multiple Allergy Intolerance observations in C-CDA. Lossless transformations may not be possible without the use of extensions ([see 3.1 of this guide](./mappingBackground.html)). +**Uncommon use case:** Multiple C-CDA Allergy Intolerance observations inside a single Allergy Concern act should map to separate and distinct FHIR AllergyIntolerance resources. The C-CDA Companion Guide ([see 5.2.7.1](https://www.hl7.org/implement/standards/product_brief.cfm?product_id=447)) actively discourages the practice of multiple observations inside a single act. It may occur, however, since Allergy Concern act allows for multiple Allergy Intolerance observations in C-CDA. Lossless transformations may not be possible without the use of extensions ([see 3.1 of this guide](./mappingBackground.html)). <br /> ### C-CDA to FHIR @@ -21,7 +21,7 @@ This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, plea |/effectiveTime/low|.onsetDateTime|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)<br/>effectiveTime/high should not be mapped within onset (DateTime or Period)| |/value|.type<br/>&<br/>.category|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>[CDA value → FHIR type](ConceptMap-CF-AllergyIntoleranceType.html) <br/> [CDA value → FHIR category](./ConceptMap-CF-AllergyIntoleranceCategory.html)| |/author|.recorder<br/>&<br/>**[Provenance](http://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-provenance.html)**|**Constraint:** Only map single CDA author to FHIR recorder<br/>[Guidance on CDA ↔ FHIR Provenance](mappingGuidance.html#cda--fhir-provenance)| -|/author/time|.recorded|**Constraint:** Only map earliest author/time <br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)| +|/author/time|.recordedDate|**Constraint:** Only map earliest author/time <br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)| |/participant/participantRole/playingEntity/code|.code|**Constraint:** When CDA negation is absent or false<br/>[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| |/participant/participantRole/playingEntity/code<br/>&<br/>/value|.code|**Constraint:** When CDA negation is true and nullFlavor is used in playingEntity/code<br/>[CDA No known allergy → FHIR code](ConceptMap-CF-NoKnownAllergies.html)<br/> When negation is true and playingEntity/code is populated, use equivalent negated concept (e.g. map latex substance to no known latex allergy [1003774007, SNOMED CT]) if available. If not, use the [substanceExposureRisk extension](https://hl7.org/fhir/extensions/StructureDefinition-allergyintolerance-substanceExposureRisk.html), placing the substance in the substance sub-extension and setting the exposureRisk sub-extension to `no-known-reaction-risk`. Note that when using this extension, the AllergyIntolerance resource will not be a conformant US Core AllergyIntolerance since the extension prohibits the required .code element.| |**[Status](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-AllergyStatusObservation.html)**<br/>/entryRelationship/observation[code/@code="33999-4"]/value³|.clinicalStatus|[CDA Allergy Status Observation value → FHIR clinicalStatus](./ConceptMap-CF-AllergyStatus.html) @@ -31,13 +31,13 @@ This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, plea |**[Comment Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-CommentActivity.html)**<br/>/entryRelationship/act[code/@code="48767-8"]/text³|**[Annotation](https://hl7.org/fhir/datatypes.html#Annotation)**<br/>.note|| -1\. XPath abbrievated for C-CDA Allergy Concern act as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="48765-2"]/entry/act/ +1\. XPath abbreviated for C-CDA Allergy Concern act as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="48765-2"]/entry/act/ -2\. XPath abbrievated for C-CDA Allergy Inteolerance observation as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="48765-2"]/entry/act/entryRelationship[@typeCode="SUBJ"]/observation +2\. XPath abbreviated for C-CDA Allergy Intolerance observation as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="48765-2"]/entry/act/entryRelationship[@typeCode="SUBJ"]/observation 3\. Note that these entryRelationships will also have inversionInd="true" in CDA -When authors or other provenance are recorded in the parent [Allergy Concern Act](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-AllergyConcernAct.html), it is recommended that those data be mapped to the FHIR AllergyIntolerance. +When authors or other provenance are recorded in the parentƒ [Allergy Concern Act](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-AllergyConcernAct.html), it is recommended that those data be mapped to the FHIR AllergyIntolerance. ### Illustrative example diff --git a/input/pagecontent/CF-encounters.md b/input/pagecontent/CF-encounters.md new file mode 100644 index 0000000..b87758a --- /dev/null +++ b/input/pagecontent/CF-encounters.md @@ -0,0 +1,36 @@ +<style> +td, th { + border: 1px solid black!important; +} +</style> + +This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, please refer to [Encounters FHIR → CDA](./FC-encounters.html). For guidance on how to read the table below, see [Reading the C-CDA ↔ FHIR Mapping Pages](./mappingGuidance.html). + +Encounter Activities in the Encounters Section (or elsewhere in the document, such as `<entryReference>` on Clinical Notes) correspond FHIR Encounter resources. If the document itself contains a `componentOf/encompassingEncounter`, this should also be converted to a FHIR Encounter resource. In all cases, when the same encounter is referenced multiple times (such as the `encompassingEncounter` and an Encounter Activity in the Encounters Section containing the same `<id>`), it should be converted to the same FHIR resource. + +### C-CDA Encounter to FHIR +<sup>(b)</sup> - indicates element is only present in Encounter Activity in the body of the document<br/><sup>(h)</sup> - indicates element is only present in EncompassingEncounter in the header of the document + +|C-CDA¹<br/>[Encounter Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-EncounterActivity.html) or [EncompassingEncounter](https://hl7.org/cda/stds/core/2.0.0-sd-snapshot1/StructureDefinition-EncompassingEncounter.html)|FHIR<br/>[Encounter](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-encounter.html)|Transform Steps| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +|/code |.class|Only the V3 ActCode system, which may be present in the root element or any `<translation>`.<br/>Other code systems may map to V3 ActCode (for example CPT codes 99211-99215 map to `AMB`, 99221-99223 to `IMP`, 99281-99285 to `EMER`, etc), but if this mapping is not possible, use the [Data Absent Reason](http://hl7.org/fhir/StructureDefinition/data-absent-reason) extension.| +|/code|.type|The remaining codes besides V3 ActCode<br/>[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|/statusCode <sup>(b)</sup>|.status|[CDA → FHIR encounter status](ConceptMap-CF-EncounterStatus.html)<br/>**Note:** statusCode is optional in C-CDA. If missing, fallback to effectiveTime mapping. +|/effectiveTime|.status|If effectiveTime is a single timestamp or contains a high, status = `"finished"`.<br/>If low is present and high is missing, the status may be `"in-progress"` but implementers may choose to evaluate historical values as `"finished"` or `"unknown"` if appropriate. +|/effectiveTime/@value<br/>/effectiveTime/low/@value|.period.start|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/effectiveTime/high/@value|.period.end +|/sdtc:dischargeDispositionCode <sup>(b)</sup><br/>/dischargeDispositionCode <sup>(h)</sup>|.hospialization.dischargeDisposition|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|/performer <sup>(b)</sup><br/>/encounterParticipant <sup>(h)</sup>|.participant|*TODO: Mapping Guidance for general performers (Participant vs ParticipantRole vs Organization)* +|/performer/sdtc:functionCode <sup>(b)</sup>|.participant.type|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|/participant[@typeCode="LOC"] <sup>(b)</sup><br/>/location <sup>(h)</sup>|.location +|**[Indication](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-Indication.html)** <sup>(b)</sup><br/>/entryRelationship[@typeCode="RSON"]/observation|.reasonCode<br/>or<br/>.reasonReference|If the id of the indication references a problem in the document that has been converted to a FHIR resource, populate .reasonReference with a reference to that resource. Otherwise, map observation/value to .reasonCode.<br/>[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|**[Encounter Diagnosis](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-EncounterDiagnosis.html)** <sup>(b)</sup><br/>/entryRelationship/act[code/@code="29308-4"]/observation|**[Encounter Diagnosis](https://hl7.org/fhir/us/core/StructureDefinition-us-core-condition-encounter-diagnosis.html)**<br/>&<br/>.diagnosis.condition|The observation maps identically to [CDA → FHIR Problems](./CF-problems.html).<br/>Since this is an encounter diagnosis, the `Observation.category` should be set to `encounter-diagnosis`. + + +### Illustrative example +... +### Links to example content +... +### Prior work and Expanded Spreadsheets +... \ No newline at end of file diff --git a/input/pagecontent/CF-immunizations.md b/input/pagecontent/CF-immunizations.md index e2a2435..d020ba8 100644 --- a/input/pagecontent/CF-immunizations.md +++ b/input/pagecontent/CF-immunizations.md @@ -40,7 +40,7 @@ Mapping is from `@moodCode="EVN"` (i.e. historical) immunizations, not `INT` (fu ### Illustrative example -{% include examplebutton.html example="CF_immunization_example" b_title = "Click on Here To See Highlighted Example" %} +{% include examplebutton.html example="CF_immunization_example" b_title = "Click Here To See Highlighted Example" %} #### Links to example content diff --git a/input/pagecontent/CF-index.md b/input/pagecontent/CF-index.md index 26392e1..092e259 100644 --- a/input/pagecontent/CF-index.md +++ b/input/pagecontent/CF-index.md @@ -9,10 +9,16 @@ #### Available Maps - [Allergies](CF-allergies.html) +- [Encounters](CF-encounters.html) - [Immunizations](CF-immunizations.html) - [Medications](CF-medications.html) +- [Notes](CF-notes.html) +- [Participation](CF-participations.html) (Including Author, DataEnterer, Informant, Performer, Participant) - [Patient](CF-patient.html) - [Problems](CF-problems.html) - [Procedures](CF-procedures.html) +- [Results](CF-results.html) +- [Social History](CF-social.html) (Including Smoking Status, Pregnancy Observation) +- [Vital Signs](CF-vitals.html) Please refer to [mapping background](mappingBackground.html) for more information how maps were selected and developed. diff --git a/input/pagecontent/CF-medications.md b/input/pagecontent/CF-medications.md index 76012b6..2742d11 100644 --- a/input/pagecontent/CF-medications.md +++ b/input/pagecontent/CF-medications.md @@ -23,7 +23,7 @@ The second `<effectiveTime>` represents the frequency and contains the attribute The C-CDA Example Search site maintains a document of [Common Medication Frequencies](http://cdasearch.hl7.org/examples/view/9588687865c0f945a326364a9449321690c7a7ef) which can be cross-referenced with a similar table in FHIR's [Timing Data Type](http://hl7.org/fhir/R4/datatypes.html#Timing) to properly map CDA frequencies to FHIR timing values. -### C-CDA to FHIR +### C-CDA to FHIR (MedicationRequest) |C-CDA¹<br>[Medication Activity substanceAdministration](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-MedicationActivity.html)|FHIR<br>[MedicationRequest](http://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-medicationrequest.html)|Transform Steps| |:----|:----|:----| @@ -34,26 +34,45 @@ The C-CDA Example Search site maintains a document of [Common Medication Frequen |/effectiveTime[1]/@value|.dosageInstruction.timing.event|**Constraint**: Use this when effectiveTime@value is populated<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)| |/effectiveTime[1]/low|.dosageInstruction.timing.repeat.boundsPeriod.start|**Constraint**: Use this when effectiveTime/@value is not populated<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)| |/effectiveTime[1]/high|.dosageInstruction.timing.repeat.boundsPeriod.end|**Constraint**: Use this when effectiveTime/@value is not populated<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)| -|**Periodic Frequency**<br/>/effectiveTime[operator="A" and xsi:type="PIVL_TS"]<br/>.../@institutionSpecified<br/>.../period/@value<br/>.../period/@unit|.dosageInstruction.timing.repeat.frequency<br/>.dosageInstruction.timing.repeat.period<br/>.dosageInstruction.timing.repeat.periodUnit|Compare:<br/>[C-CDA Common Medication Frequencies](http://cdasearch.hl7.org/examples/view/9588687865c0f945a326364a9449321690c7a7ef) and <br/>[FHIR Timing Data Type](http://hl7.org/fhir/R4/datatypes.html#Timing) +|**Periodic Frequency**<br/>/effectiveTime[operator="A" and xsi:type="PIVL_TS"]<br/>.../@institutionSpecified<br/>.../period/@value<br/>.../period/@unit|.dosageInstruction.timing.repeat.frequency<br/>.dosageInstruction.timing.repeat.period<br/>.dosageInstruction.timing.repeat.periodUnit|Compare:<br/>[C-CDA Common Medication Frequencies](http://cdasearch.hl7.org/examples/view/9588687865c0f945a326364a9449321690c7a7ef) and <br/>[FHIR Timing Data Type](http://hl7.org/fhir/R4/datatypes.html#Timing) to determine whether `frequency` or `period` should be used.<br/>If CDA `period` contains `low` and `high` (e.g. a range like 4-6 hours or 3-4 times a day), map `low` the same as `@value` (e.g. to `repeat.period` or `repeat.frequency`) and map `high` to `repeat.periodMax` or `repeat.frequencyMax` depending on whether it is a frequency or period. |**Event-Based Timing**<br/>/effectiveTime[operator="A" and xsi:type="EIVL_TS"]<br/>.../event/@code<br/>.../offset|.dosageInstruction.timing.repeat.when<br/>.dosageInstruction.timing.repeat.offset|@code vocabulary matches .when<br/>CDA offset must be converted to minutes for FHIR |/routeCode|.dosageInstruction.route|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/approachSiteCode|.dosageInstruction.site|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| |/doseQuantity|.dosageInstruction.doseAndRate.doseQuantity|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity)| |/rateQuantity|.dosageInstruction.doseAndRate.rateQuantity|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity)| -|/consumable/manufacturedProduct/manufacturedMaterial/code|.medicationCodeableConcept|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/maxDoseQuantity/numerator|.dosageInstruction.maxDosePerPeriod.numerator|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity)| +|/maxDoseQuantity/denominator|.dosageInstruction.maxDosePerPeriod.denominator|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity)| +|/administrationUnitCode|Medication.form|[See below](#c-cda-to-fhir-medication) +|/consumable/manufacturedProduct/manufacturedMaterial/code|.medicationCodeableConcept<br/>OR<br/>.medicationReference|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>Only one of these fields may be populated. When generating a Medication resource ([see below](#c-cda-to-fhir-medication)), use the medicationReference field.| +|/consumable/manufacturedProduct/manufacturerOrganization|Medication.manufacturer|[See below](#c-cda-to-fhir-medication) |/author|.requester<br/>&<br/>**[Provenance](http://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-procedure.html)**|[CDA ↔ FHIR Provenance](mappingGuidance.html#cda--fhir-provenance)| |/author/time|.authoredOn|Earliest, if more than one.<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)| -|/precondition|.asNeededBoolean = true|The presence of a precondition element indicates asNeededBoolean should be true.<br/>More complex maps may be possible with .asNeededCodeableConcept.| +|**[Drug Vehicle](https://hl7.org/cda/us/ccda/StructureDefinition-DrugVehicle.html)**<br/>/participant[@typeCode="COV"]/playingEntity/code|Medication.ingredient|[See below](#c-cda-to-fhir-medication) |**[Indication](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-Indication.html)**<br/>/entryRelationship[@typeCode="RSON"]/observation/value|.reasonCode|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| |**[Free text sig](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-MedicationFreeTextSig.html)**<br/>/entryRelationship/substanceAdministration[code/@code="76662-6"]/text|.dosageInstruction.text|| |**[Instruction Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-Instruction.html)**<br/>/entryRelationship[@typeCode="SUBJ" and @inversionInd="true"]/act|.dosageInstruction.patientInstruction<br/>.dosageInstruction.additionalInstruction|act/text or act/code/originalText can map to patientInstructions. If coded, can map to additionalInstruction. +|**[Supply Order](https://hl7.org/cda/us/ccda/StructureDefinition-MedicationSupplyOrder.html)**<br/>/entryRelationship[@typeCode="REFR"]/substanceAdministration[@moodCode="INT"]||Note: moodCode=INT means supply, moodCode=EVN means dispense, which is not documented here. +|../effectiveTime/high|.dispenseRequest.period.end|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)<br/>`low` would similarly map to `start`, but only high is called out in C-CDA.| +|../repeatNumber|.dispenseRequest.numberOfRepeatsAllowed|**Caution:** in CDA, repeatNumber indicates total number of dispenses allowed. In FHIR, this field is exclusive of the original dispense. So the `numberOfRepeatsAllowed` will be one less than `repeatNumber`. +|../quantity|.dispenseRequest.quantity|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity) |**[Comment Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-CommentActivity.html)**<br/>/entryRelationship/act[code/@code="48767-8"]/text|**[Annotation](https://hl7.org/fhir/datatypes.html#Annotation)**<br/>.note|| +|/precondition|.asNeededBoolean = true|The presence of a precondition element indicates asNeededBoolean should be true.<br/>More complex maps may be possible with .asNeededCodeableConcept.| 1\. XPath abbrievated for C-CDA Medication Activity as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="10160-0"]/entry/substanceAdministration +### C-CDA to FHIR (Medication) +MedicationRequest (and other resources) may represent the medication as a simple CodeableConcept. But when additional information about the medication needs to be conveyed, a Medication resource should be created instead and referenced by the MedicationRequest resource. Implementers may also opt to always create Medication resources. + +|C-CDA¹<br>[Medication Activity substanceAdministration](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-MedicationActivity.html)|FHIR<br>[Medication](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-medication.html)|Transform Steps| +|:----|:----|:----| +|/administrationUnitCode|.form|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|/consumable/manufacturedProduct/manufacturedMaterial/code|.code|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/consumable/manufacturedProduct/manufacturerOrganization|**[Organization](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-organization.html)**<br/>.manufacturer| +|**[Drug Vehicle](https://hl7.org/cda/us/ccda/StructureDefinition-DrugVehicle.html)**<br/>/participant[@typeCode="COV"]/playingEntity/code|.ingredient.itemCodeableConcept|Set `.isActive = false`<br/>[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) ### Illustrative example -{% include examplebutton.html example="CF_medication_example" b_title = "Click on Here To See Highlighted Example" %} +{% include examplebutton.html example="CF_medication_example" b_title = "Click Here To See Highlighted Example" %} #### Links to example content diff --git a/input/pagecontent/CF-notes.md b/input/pagecontent/CF-notes.md new file mode 100644 index 0000000..acc218d --- /dev/null +++ b/input/pagecontent/CF-notes.md @@ -0,0 +1,32 @@ +<style> +td, th { + border: 1px solid black!important; +} +</style> + +This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, please refer to [Notes FHIR → CDA](./FC-notes.html). For guidance on how to read the table below, see [Reading the C-CDA ↔ FHIR Mapping Pages](./mappingGuidance.html). + +Clinical Notes may appear in their own section or as an entry in any open section. They are identified by an `<act>` with a `<code>` value of `34109-9`. + +### C-CDA to FHIR + +|C-CDA¹<br/>[Note Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-NoteActivity.html)<br/>[DocumentReference](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-documentreference.html)|Transform Steps| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +|/code|.type|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>**NOTE:** The root code in CDA is always `34109-9: Note` which matches the FHIR Binding. +|/text/@mediaType<br/>&<br/>/text/text()|.attachment.contentType<br/>&<br/>.attachment.data|If @mediaType is present, then representation should = B64, and the inner-text contents are embedded base64-encoded data. In this case, the mediaType and base64-encoded data map 1:1 to attachment.contentType and .data. +|/text/reference/@value|.attachment.contentType<br/>&<br/>.attachment.data|Convert the narrative element referenced by @value following [Narrative Text](mappingGuidance.html#narrative-text) guidance and use `application/xhtml+xml` as the contentType.<br/>If the narrative has minimal markup (i.e. only `<content>` and `<paragraph>` elements which can be converted to line breaks), it can be converted to `text/plain`.<br/>To send the raw CDA narrative without converting, use `application/cda+xml`, but this is less useful to receivers. +|/effectiveTime|.context.period|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/author|.author +|/author/time|.date|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/entryRelationship[@typeCode=COMP]/encounter<br/>or<br/>Parent `<encounter>` element<br/>or<br/>`<encompassingEncounter>`|.context.encounter|C-CDA requires an encounter for notes, but allows for context conduction. If the Note Activity is in an entryRelationship chain that includes an Encounter Activity, use that. Otherwise, if the document contains an `<encompassingEncounter>`, that is the encounter for the note. +|/reference/externalDocument/id|.relatesTo.target|*TODO: Appropriate?* + + + +### Illustrative example +... +### Links to example content +... +### Prior work and Expanded Spreadsheets +... \ No newline at end of file diff --git a/input/pagecontent/CF-participations.md b/input/pagecontent/CF-participations.md new file mode 100644 index 0000000..d039b2e --- /dev/null +++ b/input/pagecontent/CF-participations.md @@ -0,0 +1,104 @@ +<style> +td, th { + border: 1px solid black!important; +} +</style> + +CDA defines participants in a number of elements, but the structure is often similar. These represent people (usually providers), organizations, and in some cases devices, locations, or some combination of all of the above. + +The FHIR equivalent of these fields are most commonly Practitioner, Organization, and PractitionerRole resources. Occasionally RelatedPerson, Device, or Location may be appropriate targets of CDA participants as well. + +### Comparison of CDA Participant elements + +The following table shows the common and unique fields of each CDA participation type. Since all (except Participant) are just specific flavors of participation, they can all be mapped to FHIR fairly similarly. For Participant mapping, the `@typeCode` and `@classCode` attributes are key in determining the type of FHIR resource to create. + +|[Author](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Author.html)<br/>(Non-Device)|[Data Enterer](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-DataEnterer.html)|[Informant](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Informant.html)|[Performer](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Performer2.html) / <br/>[Performer (Service Event)](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Performer1.html)|[Participant](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Participant1.html)<br/>(ClinicalDocument)|[Participant](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Participant2.html)<br/>(Everywhere Else)| +|:----|:----|:----|:----|:----|:----| +|`@typeCode=AUT`|`@typeCode=ENT`|`@typeCode=INF`|`@typeCode=PRF`|@typeCode|@typeCode +|functionCode|||sdtc:functionCode<br/>(no sdtc: in ServiceEvent)|functionCode|sdtc:functionCode +|time|time||time|time|time +||||modeCode (not in serviceEvent)||awarenessCode +|**assignedAuthor**|**assignedEntity**|**assignedEntity**<br/>or<br/>**relatedEntity**|**assignedEntity**|**associatedEntity**|**participantRole** +|`/@classCode=ASSIGNED`|`/@classCode=ASSIGNED`|/@classCode<br/>(assignedEntity = `ASSIGNED`)|/`@classCode=ASSIGNED`|/@classCode|/@classCode +|/id|/id|/id (not in related)|/id|/id|/id +|/code|/code|/code|/code|/code|/code +|/addr|/addr|/addr|/addr|/addr|/addr +|/telecom|/telecom|/telecom|/telecom|/telecom|/telecom +|||/effectiveTime (only in related) +||/sdtc:patient/id|/sdtc:patient/id (not in related)|/sdtc:patient/id +|/**assignedPerson**|/**assignedPerson**|/**assignedPerson**<br/>or<br/>/**relatedPerson**|/**assignedPerson**|/**associatedPerson**|/**playingEntity** +|//`@classCode=PSN`|//`@classCode=PSN`|//`@classCode=PSN`|//`@classCode=PSN`|//`@classCode=PSN`|//@classCode +|//name|//name|//name|//name|//name|//name +|//sdtc:desc|//sdtc:desc|//sdtc:desc|//sdtc:desc|//sdtc:desc|//desc +|//asPatientRelationship/code|//asPatientRelationship/code|//asPatientRelationship/code|//asPatientRelationship/code|//asPatientRelationship/code +||||||//code +||||||//quantity +||||||//sdtc:birthTime +|/**representedOrganization**|/**representedOrganization**|/**representedOrganization**<br/>(not in related)|/**representedOrganization**|/**scopingOrganization**|/**scopingEntity** +|/`@classCode=ORG`|/`@classCode=ORG`|/`@classCode=ORG`|/`@classCode=ORG`|/`@classCode=ORG`|//@classCode +|//id|//id|//id|//id|//id|//id +|//name|//name|//name|//name|//name|//desc +|//telecom|//telecom|//telecom|//telecom|//telecom +|//addr|//addr|//addr|//addr|//addr +|//standardIndustryClassCode|//standardIndustryClassCode|//standardIndustryClassCode|//standardIndustryClassCode|//standardIndustryClassCode|//code +|//asOrganizationPartOf (recursive)|//asOrganizationPartOf (recursive)|//asOrganizationPartOf (recursive)|//asOrganizationPartOf (recursive)|//asOrganizationPartOf + +### Mapping to different FHIR resource types + +The general process for creating FHIR resources from CDA Participations is as follows: + +- If the device element is populated (Author and Participation), create a **[Device](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-implantable-device.html)** resource +- If the relatedPerson element is present (Informant only), the `<asPatientRelationship>` element is present, or Participant/@typeCode indicates a non-clinical Person, create a **[RelatedPerson](https://hl7.org/fhir/us/core/StructureDefinition-us-core-relatedperson.html)** resource. Note that RelatedPerson has no Organization component, so if CDA conveys an organization, an additional Person resource may need to be created with a `level4` link to RelatedPerson. +- If the @typeCode (Participant only) indicates a physical location, create a **[Location](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-location.html)** resource. +- If there is no person element present and only an organization element is present, create an **[Organization](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-organization.html)** resource. +- If there is both a person element and either an organization or a person/code element (see below for more details), create a **[PractitionerRole](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-practitionerrole.html)** and **[Practitioner](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-practitioner.html)** resource. If there is an organization, also create an **[Organization](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-organization.html)** resource. + +In some cases a specific FHIR resource type may not be allowed (for example, a `.recorder` that can reference Practitioner or PractitionerRole but not Device). Implementers should be aware of requirements and make adjustments accordingly. + +### Mapping functionCode & time +In most cases the `<functionCode>` and `<time>` properties correspond to fields in the resource that is referencing the practitioner. For example, Encounter.participant.individual points to Practitioner, while CDA's `<functionCode>` would map to Encounter.participant.type. Likewise, `<time>` often maps to fields like `recorded` or `assertedDate`. + +### Mapping id +Though the `<id>` element in CDA is recorded at the role level, it is used to represent the id of the person, not their role. For example, clinicians' NPI's are recorded here. For this reason, the `<id>` should always be mapped to Practitioner.identifier or RelatedPerson.identifier, not to PractitionerRole.identifier + +Note that this is different than the `<id>` underneath `<representedOrganization>` or `<scopingOrganization>` which maps to the identifier in an Organization resource. + +### Mapping code +The `<code>` element in CDA is ambiguous and mapping to FHIR often depends on context and/or the coding system used. Common mappings to FHIR locations include: + +- **PractitionerRole.code** - role the participant is playing +- **PractitionerRole.specialty** - specific specialty of the provider +- **RelatedPerson.relationship** - when talking about a non-provider (though `<asPatientRelationship>/<code>` is a more appropriate location, it is a recently-added extension and not commonly populated) +- **Practitioner**.qualification.code - uncommon; this is more commonly found in name/suffix + +Additionally, if there is a `<representedOrganization>` or `<scopingOrganization>` with *only* a `<standardIndustryClassCode>` populated, this could also indicate specialty. + +### Practitioner vs ParticipantRole +When there is information about a person AND an organization, the PractitionerRole resource should be created to represent the role that person plays at that organization. + +Additionally, if `<code>` corresponds to role code or specialty, the PractitionerRole resource is the only way to convey this information. + +### CDA to FHIR Organization +Note when the only field populated is `<standardIndustryClassCode>`, the Organization resource can be omitted and simply populate the PractitionerRole.specialty. + +|CDA [Organization](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Organization.html)|CDA [Participant/scopingEntity](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Entity.html)<br/>(Only when `@classCode` = `ORG` or a similar class)|FHIR [Organization](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-organization.html)|Transform Steps| +|:----|:----|:---|:---| +|/id|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +|/name|/desc|.name|This is just a string in FHIR +|/telecom|/telecom|.telecom|[CDA id ↔ FHIR telecom](mappingGuidance.html#cda-telecom--fhir-telecom)| +|/addr|/addr|.address|[CDA id ↔ FHIR address](mappingGuidance.html##cda-addr--fhir-address)| +|/standardIndustryClassCode|/code|.type|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|/asOrganizationPartOf|/asOrganizationPartOf|.partOf|Recursive Organization reference + +### CDA to FHIR Practitioner + +|[AssignedAuthor](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-AssignedAuthor.html)<br/>[AssignedEntity](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-AssignedEntity.html)<br/>[AssociatedEntity](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-AssociatedEntity.html)<br/>[ParticipantRole](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-ParticipantRole.html)|[Practitioner](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-practitioner.html)|Transform Steps| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +|/code||[See Mapping code](#mapping-code)| +|/addr|.address|[CDA id ↔ FHIR address](mappingGuidance.html##cda-addr--fhir-address)| +|/telecom|.telecom|[CDA id ↔ FHIR telecom](mappingGuidance.html#cda-telecom--fhir-telecom)| +|**[Person](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Person.html)<br/>[PlayingEntity](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-PlayingEntity.html)**||Person is the CDA data type for `<assignedPerson>` and `<associatedPerson>`.| +|//name|.name|[CDA name ↔ FHIR name](mappingGuidance.html#cda-name--fhir-name)| +|//name/suffix|.qualification.code|If the suffix contains a qualifier like PhD, CNP, etc.| +|//desc|.qualification.code<br/>or<br/>.text|Only map to qualifier if desc contains a qualifier. diff --git a/input/pagecontent/CF-patient.md b/input/pagecontent/CF-patient.md index 11d4442..e0ad512 100644 --- a/input/pagecontent/CF-patient.md +++ b/input/pagecontent/CF-patient.md @@ -12,28 +12,37 @@ This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, plea |C-CDA¹<br/>[US Realm Header recordTarget](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-USRealmHeader.html)|FHIR<br/>[Patient](http://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-patient.html#profile)|Transform Steps| |:----|:----|:----| -|/patientRole/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| -|/patientRole/addr|.address|[CDA addr ↔ FHIR address ](mappingGuidance.html#cda-addr--fhir-address)| -|/patientRole/telecom|.telecom|[CDA telecom ↔ FHIR telecom](mappingGuidance.html#cda-telecom--fhir-telecom)| -|/patientRole/patient/name|.name|[CDA name ↔ FHIR name ](mappingGuidance.html#cda-name--fhir-name)| -|/patientRole/patient/administrativeGenderCode|.gender|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>[CDA administrativeGender → FHIR gender](ConceptMap-CF-AdministrativeGender.html)| -|/patientRole/patient/birthTime|.birthDate|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) <br/>**Note:** the FHIR birthDate element is less precise than the CDA birthtime element. Precision can be preserved by also using the extension [`patient-birthTime`](https://hl7.org/fhir/R4/extension-patient-birthtime.html).| -|/patientRole/patient/sdtc:deceasedInd|.deceasedBoolean|**Note:** Only one of `deceasedBoolean` or `deceasedDateTime` may exist. If both are present in CDA, use deceasedDateTime. -|/patientRole/patient/sdtc:deceasedTime|.deceasedDateTime|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) -|/patientRole/patient/maritalStatusCode|.maritalStatus|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| -|/patientRole/patient/raceCode|.extension:[us-core-race](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-race.html): ombCategory|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>This should be a category and map to the ombCategory sub-extension. But if it is a detailed race, then it should go in the detailed sub-extension.| -|/patientRole/patient/sdtc:raceCode|.extension:[us-core-race](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-race.html)|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>If code is in [OMB category](http://hl7.org/fhir/us/core/ValueSet/omb-race-category), use us-core-race: ombCategory; else use us-core-race: detailed.<br/>If the detailed race is under a different OMB category that the non-sdtc:raceCode element, then an additional OMB category sub-extension should be included as well.| -|/patientRole/patient/ethnicGroupCode|.extension:[us-core-ethnicity](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-ethnicity.html)|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>This should be a category and map to the ombCategory sub-extension. But if it is a detailed race, then it should go in the detailed sub-extension.| -|/patientRole/patient/sdtc:ethnicGroupCode|.extension:[us-core-ethnicity](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-ethnicity.html) : detailed|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>Used for detailed ethnicity| -|/patientRole/patient/languageCommunication/languageCode|.communication.language|| -|/patientRole/patient/languageCommunication/preferenceInd|.communication.preferred|| -|/patientRole/providerOrganization|.managingOrganization| - -1\. XPath abbrievated for C-CDA US Realm recordTarget as: <br/> ClinicalDocument/recordTarget/ +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +|/addr|.address|[CDA addr ↔ FHIR address ](mappingGuidance.html#cda-addr--fhir-address)| +|/telecom|.telecom|[CDA telecom ↔ FHIR telecom](mappingGuidance.html#cda-telecom--fhir-telecom)| +|/patient/name|.name|[CDA name ↔ FHIR name ](mappingGuidance.html#cda-name--fhir-name)| +|/patient/administrativeGenderCode|.gender|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>[CDA administrativeGender → FHIR gender](ConceptMap-CF-AdministrativeGender.html)| +|/patient/birthTime|.birthDate|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) <br/>**Note:** the FHIR birthDate element is less precise than the CDA birthtime element. Precision can be preserved by also using the extension [`patient-birthTime`](https://hl7.org/fhir/R4/extension-patient-birthtime.html).| +|/patient/sdtc:deceasedInd|.deceasedBoolean|**Note:** Only one of `deceasedBoolean` or `deceasedDateTime` may exist. If both are present in CDA, use deceasedDateTime. +|/patient/sdtc:deceasedTime|.deceasedDateTime|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/patient/maritalStatusCode|.maritalStatus|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/patient/religiousAffiliationCode|.extension:[patient-religion](https://hl7.org/fhir/extensions/StructureDefinition-patient-religion.html).valueCodeableConcept|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|/patient/raceCode|.extension:[us-core-race](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-race.html): ombCategory|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>This should be a category and map to the ombCategory sub-extension. But if it is a detailed race, then it should go in the detailed sub-extension.| +|/patient/sdtc:raceCode|.extension:[us-core-race](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-race.html)|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>If code is in [OMB category](http://hl7.org/fhir/us/core/ValueSet/omb-race-category), use us-core-race: ombCategory; else use us-core-race: detailed.<br/>If the detailed race is under a different OMB category that the non-sdtc:raceCode element, then an additional OMB category sub-extension should be included as well.| +|/patient/raceCode/originalText<br/>and<br/>/patient/sdtc:raceCode/originalText|.extension:[us-core-race](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-race.html): text|The race extension's text sub-extension is required but may only exist once. Recommendation is to comma-delimit all originalText / displayNames available, taking care to not duplicate values. +|/patient/ethnicGroupCode|.extension:[us-core-ethnicity](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-ethnicity.html)|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>This should be a category and map to the ombCategory sub-extension. But if it is a detailed race, then it should go in the detailed sub-extension.| +|/patient/sdtc:ethnicGroupCode|.extension:[us-core-ethnicity](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-ethnicity.html) : detailed|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>Used for detailed ethnicity| +|/patient/guardian/code<br/>and<br/>/patient/guardian/guardianPerson/sdtc:asPatientRelationship/code|.contact.relationship|First, add a fixed relationship code of `GUARD` from [v3 RoleCode](http://terminology.hl7.org/CodeSystem/v3-RoleCode) (`http://terminology.hl7.org/CodeSystem/v3-RoleCode`) to preserve the CDA guardian relationship. Then map the two fields to additional relationship entries using [CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) +|/patient/guardian/addr|.contact.address|[CDA addr ↔ FHIR address ](mappingGuidance.html#cda-addr--fhir-address)| +|/patient/guardian/telecom|.contact.telecom|[CDA telecom ↔ FHIR telecom](mappingGuidance.html#cda-telecom--fhir-telecom)| +|/patient/guardian/guardianPerson/name|.contact.name|[CDA name ↔ FHIR name ](mappingGuidance.html#cda-name--fhir-name)| +|/patient/birthPlace/place/addr|.extension:[patient-birthPlace](http://hl7.org/fhir/StructureDefinition/patient-birthPlace).valueAddress|[CDA addr ↔ FHIR address ](mappingGuidance.html#cda-addr--fhir-address)| +|/patient/languageCommunication/languageCode|.communication.language|| +|/patient/languageCommunication/preferenceInd|.communication.preferred|| +|/patient/languageCommunication/modeCode|.communication.extension:[patient-proficiency](http://hl7.org/fhir/StructureDefinition/patient-proficiency):type|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>If both modeCode and proficiencyLevelCode are set for a language, only one `patient-proficiency` extension is needed. +|/patient/languageCommunication/proficiencyLevelCode|.communication.extension:[patient-proficiency](http://hl7.org/fhir/StructureDefinition/patient-proficiency):level|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)<br/>If both modeCode and proficiencyLevelCode are set for a language, only one `patient-proficiency` extension is needed. +|/providerOrganization|.managingOrganization| + +1\. XPath abbrievated for C-CDA US Realm recordTarget as: <br/> ClinicalDocument/recordTarget/patientRole ### Illustrative example -{% include examplebutton.html example="CF_patient_example" b_title = "Click on Here To See Highlighted Example" %} +{% include examplebutton.html example="CF_patient_example" b_title = "Click Here To See Highlighted Example" %} #### Links to example content diff --git a/input/pagecontent/CF-problems.md b/input/pagecontent/CF-problems.md index 36c2f15..c595e51 100644 --- a/input/pagecontent/CF-problems.md +++ b/input/pagecontent/CF-problems.md @@ -29,16 +29,18 @@ Note that C-CDA includes a Concern wrapper act from which status may be read; mo |**[Problem Status](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-ProblemStatus.html)**<br/>/entryRelationship/observation[code/@code="33999-4"]/value|.clinicalStatus|[CDA Problem Status Observation value → FHIR clinicalStatus](./ConceptMap-CF-ProblemStatus.html)| |**[Date of Diagnosis](https://www.hl7.org/ccdasearch/templates/2.16.840.1.113883.10.20.22.4.502.html)**<br/>/entryRelationship/act[code/@code="77975-1"]/effectiveTime|.extension:[assertedDate](http://hl7.org/fhir/StructureDefinition/condition-assertedDate)|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)<br/>See **[US CORE Condition](https://hl7.org/fhir/us/core/StructureDefinition-us-core-condition-problems-health-concerns.html#mandatory-and-must-support-data-elements)** for additional guidance| |**[Comment Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-CommentActivity.html)**<br/>/entryRelationship/act[code/@code="48767-8"]/text|**[Annotation](https://hl7.org/fhir/datatypes.html#Annotation)**<br/>.note|| +|**[Age Observation]()**<br/>/entryRelationship[@typeCode="SUBJ" and @inversionInd="true"]/observation[code/@code="445518008"]/value|.onsetAge|**CAUTION:** Only one of `onsetAge` or `onsetDateTime` may be present.<br/>[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity) +|**Supporting Observations (e.g. [Assessment Scale Observation](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-AssessmentScaleObservation.html))**<br/>/entryRelationship[@typeCode="SPRT"]/observation|.evidence.detail|Create an Observation resource, mapping fields like `id`, `code`, `effectiveTime`, `value` similar to [Results](CF-results.html). If the CDA observation is an SDOH observation, use the [US Core Observation Screening Assessment](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-observation-screening-assessment.html) profile. -1\. XPath abbrievated for C-CDA Problem Concern act as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="11450-4"]/entry/act/ +1\. XPath abbreviated for C-CDA Problem Concern act as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="11450-4"]/entry/act/ -2\. XPath abbrievated for C-CDA Problem Observation as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="11450-4"]/entry/act/entryRelationship[@typeCode="SUBJ"]/observation/ +2\. XPath abbreviated for C-CDA Problem Observation as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="11450-4"]/entry/act/entryRelationship[@typeCode="SUBJ"]/observation/ When authors or other provenance are recorded in the parent [Problem Concern Act](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-ProblemConcernAct.html), it is recommended that those data be mapped to the FHIR Condition. ### Illustrative example -{% include examplebutton.html example="CF_problem_example" b_title = "Click on Here To See Highlighted Example" %} +{% include examplebutton.html example="CF_problem_example" b_title = "Click Here To See Highlighted Example" %} #### Links to example content diff --git a/input/pagecontent/CF-procedures.md b/input/pagecontent/CF-procedures.md index eb637b3..e59e971 100644 --- a/input/pagecontent/CF-procedures.md +++ b/input/pagecontent/CF-procedures.md @@ -33,7 +33,7 @@ C-CDA 2.1 describes three templates for Procedures: Procedure Activity Act, Proc ### Illustrative example -{% include examplebutton.html example="CF_procedure_example" b_title = "Click on Here To See Highlighted Example" %} +{% include examplebutton.html example="CF_procedure_example" b_title = "Click Here To See Highlighted Example" %} #### Links to example content diff --git a/input/pagecontent/CF-results.md b/input/pagecontent/CF-results.md new file mode 100644 index 0000000..58d1864 --- /dev/null +++ b/input/pagecontent/CF-results.md @@ -0,0 +1,54 @@ +<style> +td, th { + border: 1px solid black!important; +} +</style> + +This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, please refer to [Results FHIR → CDA](./FC-results.html). For guidance on how to read the table below, see [Reading the C-CDA ↔ FHIR Mapping Pages](./mappingGuidance.html). + +Results in C-CDA are collected into `<organizer>` elements containing one or more result `<observation>` element. This corresponds to one FHIR DiagnosticReport for the `<organizer>` which multiple `.result` references to FHIR Observation resources, one for each CDA `<observation>`. + +Observation values are generic - they can be of any CDA type in CDA, and *almost* any DataType in FHIR. In CDA, the type is represented by the `xsi:type` attribute on the `<value>` element. In FHIR, the type is represented by the `.value[x]` element; the `[x]` represents a choice among data types, so `.valueQuantity` represents a quantity data type, `.valueInteger` represents a numeric whole number, etc. Not every CDA type is a 1:1 match for a FHIR type, but significant differences have been included in the tables below. + +### C-CDA Organizer to FHIR Diagnostic Report + +|C-CDA¹<br/>[Result Organizer](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-ResultOrganizer.html)|FHIR<br/>Diagnostic Report ([Lab](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-diagnosticreport-lab.html)) ([Reports](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-diagnosticreport-note.html))|Transform Steps| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +|/code|.category<br/>&<br/>.code|*TODO: Describe using LOINC classes to identify category*<br/>[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/statusCode|.status|*TODO: ConceptMap* +|/effectiveTime|.effectiveDateTime<br/>or<br/>.effectivePeriod|If low and high are identical, use effectiveDateTime. If organizer/effectiveTime is missing, use the earliest and latest observation/effectiveTime as the source of the mapping.<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/specimen||*TODO* +|/author||*TODO* +|/component/observation|.result|See following table + +### C-CDA Observation to FHIR Observation + +|C-CDA¹<br/>[Result Observation](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-ResultObservation.html)|FHIR<br/>[Lab Result Observation](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-observation-lab.html)|Transform Steps| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +|(parent organizer)|.category|Use category from DiagnosticReport or map /code to a category similarly +|/code |.code|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/statusCode|.status|*TODO: ConceptMap* +|/effectiveTime|.effectiveDateTime<br/>or<br/>.effectivePeriod|Prefer effectiveDateTime<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/value[xsi:type=PQ]|.valueQuantity|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity) +|/value[xsi:type=IVL_PQ]|.valueQuantity<br/>or<br/>.valueRange|[Ranges of Physical Quantities](mappingGuidance.html#ranges-of-physical-quantities) +|/value[xsi:type=CD]<br/>(or CE, CV, CO, CS)|.valueCodeableConcept|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/value[xsi:type=INT]|.valueInteger| +|/value[xsi:type=REAL]|.valueQuantity|Leave unit fields empty +|/value[xsi:type=ST]|.valueString| +|/interpretationCode|.interpretation|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/methodCode|.method|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/targetSiteCode|.bodySite|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/author|**[Provenance](http://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-provenance.html)**|[CDA ↔ FHIR Provenance](mappingGuidance.html#cda--fhir-provenance)| +|/referenceRange/observationRange/interpretationCode|**Not Supported**|FHIR expects reference ranges to be "normal" ranges. If C-CDA includes multiple reference ranges, only map the one with interpretationCode = `"N"`. +|/referenceRange/observationRange/value[xsi:type=IVL_PQ]|.referenceRange.low<br/>&<br/>.referenceRange.high| +|/referenceRange/observationRange/value[xsi:type=ST]<br/>or<br/>/referenceRange/observationRange/text|.referenceRange.text| + + +### Illustrative example +... +### Links to example content +... +### Prior work and Expanded Spreadsheets +... \ No newline at end of file diff --git a/input/pagecontent/CF-social.md b/input/pagecontent/CF-social.md new file mode 100644 index 0000000..7db68e8 --- /dev/null +++ b/input/pagecontent/CF-social.md @@ -0,0 +1,68 @@ +<style> +td, th { + border: 1px solid black!important; +} +</style> + +This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, please refer to [Results FHIR → CDA](./FC-results.html). For guidance on how to read the table below, see [Reading the C-CDA ↔ FHIR Mapping Pages](./mappingGuidance.html). + +Social History is a category of several templates in C-CDA and several profiles in US Core. At a high-level, mappings between CDA `<observation>` acts and FHIR Observation resources are similar and are represented by the top table. Differences are documented on the proceeding tables. + +Note that some observations in C-CDA map to extensions on the patient or elsewhere in FHIR. In these cases, a FHIR Observation should not be created; instead, the corresponding extension should be used. + +- [C-CDA Birth Sex Observation](https://hl7.org/cda/us/ccda/StructureDefinition-BirthSexObservation.html) ↔ [US Core Birth Sex Extension](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-birthsex.html) +- [C-CDA Gender Identity Observation](https://hl7.org/cda/us/ccda/StructureDefinition-GenderIdentityObservation.html) ↔ [US Core Gender Identity Extension](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-genderIdentity.html) +- [C-CDA Sex Observation](https://hl7.org/cda/us/ccda/StructureDefinition-SexObservation.html) ↔ [US Core Sex Extension](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-sex.html) +- [C-CDA Tribal Affiliation Observation](https://hl7.org/cda/us/ccda/StructureDefinition-TribalAffiliationObservation.html) ↔ [US Core Tribal Affiliation Extension](https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-tribal-affiliation.html) + +### C-CDA Social History Observation to FHIR Observation +This maps to US Core version 6's Simple Observation. Previous versions of US Core did not define a generic observation, but the following guidance can still be used to create a generic FHIR observation regardless of the version of US Core being targeted. + +|C-CDA<br/>[Social History Observation](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-SocialHistoryObservation.html)|FHIR<br/>[Simple Observation](https://hl7.org/fhir/us/core/STU6/StructureDefinition-us-core-simple-observation.html)|Transform Steps| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +||.category|Set to `social-history` from [Observation Category Codes](https://build.fhir.org/ig/HL7/UTG/CodeSystem-observation-category.html)<br/>Additional SDOH categories may be set as well, depending on the code of the observation. +|/code |.code|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/statusCode|.status|*TODO: ConceptMap* +|/effectiveTime|.effectiveDateTime<br/>or<br/>.effectivePeriod|Prefer effectiveDateTime<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/value[xsi:type=PQ]|.valueQuantity|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity) +|/value[xsi:type=IVL_PQ]|.valueQuantity<br/>or<br/>.valueRange|[Ranges of Physical Quantities](mappingGuidance.html#ranges-of-physical-quantities) +|/value[xsi:type=CD]<br/>(or CE, CV, CO, CS)|.valueCodeableConcept|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/value[xsi:type=INT]|.valueInteger| +|/value[xsi:type=REAL]|.valueQuantity|Leave unit fields empty +|/value[xsi:type=ST]|.valueString| + +Additional fields, such as `.interpretationCode`, `.referenceRange`, `.performer` are not documented in C-CDA but can be mapped in the same manner as [Results](./CF-results.html). + +### C-CDA Smoking Status / Tobacco Use to FHIR Observation +In C-CDA 3.0, the Smoking Status - MU and Tobacco Use templates were merged into a single template to better match US Core's Smoking Status template. + +|C-CDA<br/>[Smoking Status - MU](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-SmokingStatusMeaningfulUse.html) (Deprecated)<br/>[Tobacco Use](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-TobaccoUse.html) (Decprecated)<br/>[Smoking Status](https://build.fhir.org/ig/HL7/CDA-ccda/StructureDefinition-SmokingStatus.html) (C-CDA 3.0)²|FHIR<br/>[Smoking Status Observation](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-smokingstatus.html)|Transform Steps| +|:----|:----|:----| +|/code|.code|Prior to US Core 7, the code should be `72166-2 (Tobacco smoking status NCIS)`, but this is an extensible value set.<br/>In US Core 7, the value set remains extensible, but contains the same 4 concepts allowed in the C-CDA R3.0's Smoking Status value set. +|/effectiveTime|.effectiveDateTime<br/>or<br/>.effectivePeriod|Smoking Status - MU required a timestamp; Tobacco Use required a time range; Smoking Status (3.0) combines the two templates into one and allows for either. + +### C-CDA Pregnancy Observation to FHIR Pregnancy Status Observation +In US Core, Pregnancy Observation was first defined in version 6. + +|C-CDA<br/>[Pregnancy Observation](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-PregnancyObservation.html)|FHIR<br/>[Pregnancy Status](https://hl7.org/fhir/us/core/STU6.1/StructureDefinition-us-core-observation-pregnancystatus.html)|Transform Steps| +|:----|:----|:----| +|.moodCode||The C-CDA moodCode is `EVN` which is why this maps to FHIR's Pregnancy Status rather than Pregnancy Intent. +||.code|`82810-3 (Pregnancy Status)` - C-CDA uses `ASSERTION`, but FHIR clarifies the code to be used. +|/effectiveTime/@value<br/>or<br/>/effectiveTime/low/@value<br/>or<br/>/effectiveTime/high/@value<br/>or<br/>/author/time|.effectiveDateTime|FHIR only allows a single timestamp. Send the first element from the first column with a populated timestamp.<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|/value|.valueCodeableConcept|Value sets are the same<br/>[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/value/@nullFlavor=UNK|.valueCodeableConcept|Unknown becomes an actual value with system = `http://terminology.hl7.org/CodeSystem/v3-NullFlavor`. Any other nullFlavors should use a data-absent-reason extension. +|**[Estimated Date of Delivery](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-EstimatedDateofDelivery.html)**<br/>/entryRelationship/observation[code/@code="11778-8"]/value|.component.code<br/>.component.valueDateTime|Set code to `11778-8` and map value to `.valueDateTime`.<br/>Note that while C-CDA hard-codes this to a single value (`11778-8`), there are other, more specific, EDD LOINC codes that could be used as well (see [EDD Including Method](https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.11.20.9.81/expansion)). These might be communicated as translations on the entryRelationship/observation/code, as the methodCode, or sent as entirely custom observations. Any of these codes can also reasonably be included as a component to a Pregnancy Observation to represent the estimated date of delivery. + +### C-CDA Pregnancy Intention in Next Year to FHIR Pregnancy Intent Observation +In US Core, Pregnancy Intent was first defined in version 6. + +|C-CDA<br/>[Pregnancy Intention](https://hl7.org/cda/us/ccda/StructureDefinition-PregnancyIntentionInNextYear.html)|FHIR<br/>[Pregnancy Intent](https://hl7.org/fhir/us/core/STU6/StructureDefinition-us-core-observation-pregnancyintent.html)|Transform Steps| +|:----|:----|:----| +|.moodCode||The C-CDA moodCode is `INT` which is why this maps to FHIR's Pregnancy Status rather than Pregnancy Intent. +|/code|.code|In both standards, the code is `86645-9` +|/effectiveTime/low/@value|.effectiveDateTime|FHIR only allows a single timestamp which corresponds to C-CDA's "low" +|/value|.valueCodeableConcept|Value sets are the same<br/>[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/value/@nullFlavor=UNK|.valueCodeableConcept|Unknown becomes an actual value with system = `http://terminology.hl7.org/CodeSystem/v3-NullFlavor`. Any other nullFlavors should use a data-absent-reason extension. + + diff --git a/input/pagecontent/CF-vitals.md b/input/pagecontent/CF-vitals.md new file mode 100644 index 0000000..0c0dcb8 --- /dev/null +++ b/input/pagecontent/CF-vitals.md @@ -0,0 +1,57 @@ +<style> +td, th { + border: 1px solid black!important; +} +</style> + +This page provides a mapping from CDA to FHIR. For the FHIR to CDA mapping, please refer to [Vitals FHIR → CDA](./FC-vitals.html). For guidance on how to read the table below, see [Reading the C-CDA ↔ FHIR Mapping Pages](./mappingGuidance.html). + +C-CDA vitals are typically grouped into a Vital Signs Organizer to group one or more vitals readings together. This has been mapped to an additional FHIR Observation for the panel of vital signs. This panel contains a `.hasMember` field which references each observation mapped from the original C-CDA Vital Signs Organizer. + +### C-CDA Vital Signs Organizer to FHIR Observation Panel + +|C-CDA¹<br/>[Vital SignsOrganizer](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-VitalSignsOrganizer.html)|FHIR<br/>[Vital Signs Observation](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-vital-signs.html)|Transform Steps| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +||.category|Set to `vital-signs` from [Vital Signs value set](https://hl7.org/fhir/us/core/STU4/ValueSet-us-core-vital-signs.html) +||.code|Set to `85353-1` [CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/statusCode|.status|`final` (C-CDA is fixed to `completed`) +|/effectiveTime|.effectiveDateTime<br/>or<br/>.effectivePeriod|If low and high are identical, use effectiveDateTime. If organizer/effectiveTime is missing, use the earliest and latest observation/effectiveTime as the source of the mapping.<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +||.hasMember|Reference to each vital sign observation mapped from CDA + +### C-CDA Vital Signs Observation to FHIR Observation + +|C-CDA¹<br/>[Vital Sign Observation](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-VitalSignObservation.html)|FHIR<br/>[Vital Signs Observation](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-vital-signs.html)|Transform Steps<br/>Note: US Core defines separate profiles for individual vitals such as [weight](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-body-weight.html), [heart rate](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-heart-rate.html), etc.| +|:----|:----|:----| +|/id|.identifier|[CDA id ↔ FHIR identifier](mappingGuidance.html#cda-id--fhir-identifier)| +||.category|Set to `vital-signs` from [Vital Signs value set](https://hl7.org/fhir/us/core/STU4/ValueSet-us-core-vital-signs.html) +|/code |.code²|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/effectiveTime|.effectiveDateTime<br/>or<br/>.effectivePeriod|Prefer effectiveDateTime<br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|value|.valueQuantity²|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity) +|/interpretationCode|.interpretation²|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/methodCode|.method|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/targetSiteCode|.bodySite|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)| +|/author|.performer<br/>&<br/>**[Provenance](http://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-procedure.html)**|[CDA ↔ FHIR Provenance](mappingGuidance.html#cda--fhir-provenance)| +|/referenceRange/observationRange/interpretationCode|**Not Supported**|FHIR expects reference ranges to be "normal" ranges. If C-CDA includes multiple reference ranges, only map the one with interpretationCode = `"N"`. +|/referenceRange/observationRange/value[xsi:type=IVL_PQ]|.referenceRange.low²<br/>&<br/>.referenceRange.high²|[CDA ↔ FHIR Quantity](mappingGuidance.html#cda--fhir-quantity) +|/referenceRange/observationRange/value[xsi:type=ST]<br/>or<br/>/referenceRange/observationRange/text|.referenceRange.text²| + +1\. XPath abbreviated for C-CDA Vital Signs Observation as: <br/> ClinicalDocument/component/structuredBody/component/section[code/@code="8716-3"]/entry/organizer/entryRelationship/component + +2\. Some C-CDA observations need special handling when converting to FHIR. When recording the following vitals, the value, interpretation, and referenceRange should be placed in a `.component` element within a parent Observation. + +**[Blood Pressure](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-blood-pressure.html)** (LOINC codes `8480-6` - systolic & `8462-4` - diastolic) +- Set `Observation.code` to `85354-9` (Blood Pressure Panel) and create 2 components for the systolic and diastolic readings. Both components are required. +- Do not send `Observation.valueQuantity` + +**[Pulse Oximetry](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-pulse-oximetry.html)** (LOINC codes `3150-0` - Inhaled Oxygen Concentration & `3151-8` - Inhaled Oxygen Flow Rate) +- `Observation.code` should contain two coding values: `59408-5` & `2708-6` +- Observation.valueQuantity represents the Oxygen saturation (e.g. `98%`) +- Create individual components for `3150-0` - Inhaled Oxygen Concentration & `3151-8` - Inhaled Oxygen Flow Rate + +### Illustrative example +... +### Links to example content +... +### Prior work and Expanded Spreadsheets +... \ No newline at end of file diff --git a/input/pagecontent/FC-encounters.md b/input/pagecontent/FC-encounters.md new file mode 100644 index 0000000..ae8e0d6 --- /dev/null +++ b/input/pagecontent/FC-encounters.md @@ -0,0 +1 @@ +*Coming soon...* \ No newline at end of file diff --git a/input/pagecontent/FC-notes.md b/input/pagecontent/FC-notes.md new file mode 100644 index 0000000..ae8e0d6 --- /dev/null +++ b/input/pagecontent/FC-notes.md @@ -0,0 +1 @@ +*Coming soon...* \ No newline at end of file diff --git a/input/pagecontent/FC-results.md b/input/pagecontent/FC-results.md new file mode 100644 index 0000000..ae8e0d6 --- /dev/null +++ b/input/pagecontent/FC-results.md @@ -0,0 +1 @@ +*Coming soon...* \ No newline at end of file diff --git a/input/pagecontent/FC-social.md b/input/pagecontent/FC-social.md new file mode 100644 index 0000000..ae8e0d6 --- /dev/null +++ b/input/pagecontent/FC-social.md @@ -0,0 +1 @@ +*Coming soon...* \ No newline at end of file diff --git a/input/pagecontent/FC-vitals.md b/input/pagecontent/FC-vitals.md new file mode 100644 index 0000000..1248c4b --- /dev/null +++ b/input/pagecontent/FC-vitals.md @@ -0,0 +1,40 @@ +<style> +td, th { + border: 1px solid black!important; +} +</style> + +This page provides a mapping from FHIR to CDA. For the CDA to FHIR mapping, please refer to [Vitals CDA → FHIR](./CF-vitals.html). For guidance on how to read the table below, see [Reading the FHIR ↔ C-CDA Mapping Pages](./mappingGuidance.html). + +FHIR Vitals that are grouped into a panel using the memberOf property are mapped to a CDA Vital Signs Organizer. + +### FHIR Observation Panel to C-CDA Vital Signs Organizer + +|FHIR<br/>[Vital Signs Observation](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-vital-signs.html)|C-CDA¹<br/>[Vital SignsOrganizer](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-VitalSignsOrganizer.html)|Transform Steps| +|:----|:----|:----| +|.identifier|/id|[FHIR identifier ↔ CDA id](mappingGuidance.html#fhir-identifier--cda-id)| +|.category = `vital-signs` from [Vital Signs value set](https://hl7.org/fhir/us/core/STU4/ValueSet-us-core-vital-signs.html)|| +|.code = `85353-1` [CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)||| +|.status|/statusCode|*TODO: ConceptMap* +|.effectiveDateTime|/effectiveTime|Use value +|.effectivePeriod|/effectiveTime|Use high and low <br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|.hasMember|component|Reference to each vital sign observation + +### FHIR Observation to C-CDA Vital Signs Observation + +|FHIR<br/>[Vital Signs Observation](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-vital-signs.html)|C-CDA¹<br/>[Vital Sign Observation](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-VitalSignObservation.html)|Transform Steps| +|:----|:----|:----| +|.identifier|/id|[FHIR identifier ↔ CDA id](mappingGuidance.html#fhir-identifier--cda-id)| +|.code |/code|[FHIR CodeableConcept ↔ CDA coding ](mappingGuidance.html#fhir-codeableconcept--cda-coding)| +|.status|/statusCode|Set to completed +|.effectiveDateTime|/effectiveTime|Use value +|.effectivePeriod|/effectiveTime|Use high and low <br/>[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates) +|.valueQuantity|/value|If not null <br> [FHIR ↔ CDA Quantities](mappingGuidance.html#cda--fhir-quantity) +|.dataAbsentReason|/value@nullFlavor|If value is null<br>[FHIR DataAbsentReason ↔ CDA NullFlavor](ConceptMap-FC-DataAbsentReasonNullFlavor.html) +|.interpretation|/interpretationCode|[FHIR CodeableConcept ↔ CDA coding](mappingGuidance.html#fhir-codeableconcept--cda-coding)| +|.method|/methodCode|[FHIR CodeableConcept ↔ CDA coding](mappingGuidance.html#fhir-codeableconcept--cda-coding)| +|.bodySite|/targetSiteCode|[FHIR CodeableConcept ↔ CDA coding](mappingGuidance.html#fhir-codeableconcept--cda-coding)| +|||author-provenance: *TODO* + + +### Illustrative example \ No newline at end of file diff --git a/input/pagecontent/conceptMaps.md b/input/pagecontent/conceptMaps.md index 8adee1b..75664ee 100644 --- a/input/pagecontent/conceptMaps.md +++ b/input/pagecontent/conceptMaps.md @@ -13,6 +13,7 @@ Shown below are terminology mappings for use in moving from CDA → FHIR. Entry - [Allergy Intolerance Observation value (CDA) → AllergyIntolerance category (FHIR)](./ConceptMap-CF-AllergyIntoleranceCategory.html) - [Allergy Status Observation (CDA) → AllergyIntolerance clinicalStatus (FHIR)](./ConceptMap-CF-AllergyStatus.html) - [Criticality value (CDA) → criticality (FHIR)](./ConceptMap-CF-Criticality.html) +- [Encounter status (CDA) → Encounter status (FHIR)](./ConceptMap-CF-EncounterStatus.html) - [Immunization Activity statusCode (CDA) → Immunization status (FHIR)](./ConceptMap-CF-ImmunizationStatus.html) - [Immunization Refusal Reason (CDA) → Immunization statusReason (FHIR)](./ConceptMap-CF-ImmunizationRefusal.html) - [Medication Activity statusCode (CDA) → MedicationRequest status (FHIR)](./ConceptMap-CF-MedicationStatus.html) diff --git a/input/pagecontent/mappingGuidance.md b/input/pagecontent/mappingGuidance.md index 62adc4e..e77c531 100644 --- a/input/pagecontent/mappingGuidance.md +++ b/input/pagecontent/mappingGuidance.md @@ -27,6 +27,10 @@ Examples for C-CDA to FHIR transforms are provided based on a consensus of vario The highlighted output images were created using an [open source tool for C-CDA ↔ FHIR Mapping](https://github.com/jddamore/cda-fhir-compare) developed as part of this project. +#### Missing Maps + +If you have data in an input artifact that is defined in the source specification and for which no map is specified here, that means that this team did not find a target for which we could build consensus. In most cases, this means that the data is unusual enough that the target specification did not address it (e.g., treatments for allergy reactions, which would probably be reported in the Problems or Procedures section rather than the Allergies section). In these cases, the team felt that converging on one design from the many solution possible patterns was not an optimal investment of resources. If readers identify elements for which this seems insufficient, they should comment. + ### CDA id ↔ FHIR identifier Identifiers in both FHIR and CDA can divide the identifier value from its namespace: FHIR as the identifier.system and CDA as the id.root. In many cases, this correspondence works well. @@ -81,12 +85,12 @@ CDA timestamp values are based on a pattern of YYYYMMDDHHmmss+zzzz and [FHIR dat To convert between the standards, systems should deploy programming logic that converts formats and preserves the level of precision. For example, "20230531" from CDA would become "2023-05-31" in FHIR (not 2023-05-31T00:00:00+00:00). Additional examples below: -|CDA Date Time|FHIR Date Time| +|CDA Date Time|FHIR Date Time|Notes| |:-----|:-----|:-------------| |2023|2023| |202305|2023-05| |20230531|2023-05-31| -|202305312205-0500|2023-05-31T22:05-05:00| +|202305312205-0500|2023-05-31T22:05-05:00|Timezone offset should be preserved Note that in C-CDA, timezone offset is a SHOULD, while in FHIR, time zone offset is required when more specific than the day. There may be instances where a CDA date-time value omits a time zone offset and other data from the document may be necessary to populate FHIR dateTime requirements. @@ -139,6 +143,15 @@ In addition to the context of the previous section, CDA often requires elements Note that C-CDA sometimes requires a code from a specific system in the root of a CD and permits others in the translation +#### FHIR Code → CDA Coding + +Both CDA and FHIR employ a hierarchy of simpler types and more complex types that re-use the simpler ones. In some cases, a simpler type on one side will map to a more complex one on the other. Where the complexity supports metadata, these maps are essentially the same as the complex-to-complex maps (Coding & CodeableConcept, above). In a few cases, a complex type supports representing a simple source where a simple target would have failed. + +|FHIR Property|CDA Target|Notes| +|:-----|:-----|:-------------| +|code|originalText|If the CDA element is mapped to a value set that has no translation for the FHIR value, the FHIR value can be placed in orginalText. This does not satisfy CDA terminology bindings, should they exist.| + + #### Mapping OID ↔ URI FHIR requires that certain terminologies use a specific uniform resource identifier (URI) while CDA always uses object identifiers (OIDs) for codeSystems. This means: @@ -230,6 +243,223 @@ When mapping from FHIR to CDA, if the system is `http://unitsofmeasure.org`, the UCUM also provides the ability to include arbitrary units within a set of curly brackets (e.g. `{INR}`). No specific guidance on the use of curly brackets in unit translation is provided in this publication, however additional guidance on UCUM arbitrary units is [available here](https://ucum.org/ucum#section-Arbitrary-Units). +#### Ranges of Physical Quantities +CDA conveys ranges of values using the `IVL_PQ` data type. The `<low>` and `<high>` elements are normal Physical Quantity (PQ) elements with an additional `@inclusive` attribute. When this is present and set to `"false"`, the value of the boundary is not included in the range. The default value of this attribute is `"true"`, so regardless of whether it is absent or set to `"true"`, the value of the boundary IS included in the range. + +In FHIR, ranges with both a low and high are represented in the [Range](https://hl7.org/fhir/R4/datatypes.html#Range) data type, while ranges with only a low or a high are represented in the [Quantity](https://hl7.org/fhir/R4/datatypes.html#Quantity) data type using a [comparator](https://hl7.org/fhir/R4/valueset-quantity-comparator.html). + +Since a physical quantity is something that can be measured, a missing `<low>` value or a low value of `0` can be represented as `<` or `<=` the high value (based on the `@inclusive` property on `<high>`). If the `<high>` value is missing, it generally means the value was too large to measure, and the FHIR representation is `>` or `>=`. + +Note that in FHIR, `Observation.referenceRange` only contains `.low` and `.high` values, so this guidance is targeted to the actual values of observations. + +<table> +<tr><th>CDA IVL_PQ Value - High-only</th><th>FHIR Quantity</th></tr> +<tr><td> +<div markdown="1"> +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <high value="200" unit="mg/dL"/> +</value> +{% endhighlight %} +or +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low value="0" unit="mg/dL"/> + <high value="200" unit="mg/dL"/> +</value> +{% endhighlight %} +or + +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low nullFlavor="NINF"/> + <high value="200" unit="mg/dL"/> +</value> +{% endhighlight %} + +</div> + +</td><td> +<div markdown="1"> +{% highlight json %} +"quantity": { + "value": 200, + "comparator": "<=", + "unit": "mg/dL", + "code": "mg/dL", + "system": "http://unitsofmeasure.org" +} +{% endhighlight %} + +(`<=` because inclusive is true by default) +</div> + +</td></tr> +<tr><td> +<div markdown="1"> +When `@inclusive="false"`: + +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <high value="200" unit="mg/dL" inclusive="false"/> +</value> +{% endhighlight %} +</div> + +</td><td> +<div markdown="1"> +{% highlight json %} +"quantity": { + "value": 200, + "comparator": "<", + "unit": "mg/dL", + "code": "mg/dL", + "system": "http://unitsofmeasure.org" +} +{% endhighlight %} +</div> + +</td></tr> +<tr><td colspan="2"> </td></tr> +<tr><th>CDA IVL_PQ Value - Low-only</th><th>FHIR Quantity</th></tr> +<tr><td> +<div markdown="1"> +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low value="500" unit="mg/dL" inclusive="true"/> + <high nullFlavor="PINF"> +</value> +{% endhighlight %} + +or + +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low value="500" unit="mg/dL"/> +</value> +{% endhighlight %} + +</div> + +</td><td> +<div markdown="1"> +{% highlight json %} +"quantity": { + "value": 500, + "comparator": ">=", + "unit": "mg/dL", + "code": "mg/dL", + "system": "http://unitsofmeasure.org" +} +{% endhighlight %} + + +(`>=` because inclusive is true by default) +</div> + +</td></tr> +<tr><td> +<div markdown="1"> +When `@inclusive="false"`: +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low value="500" unit="mg/dL" inclusive="false"/> + <high nullFlavor="PINF"/> +</value> +{% endhighlight %} + +or + +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low value="500" unit="mg/dL" inclusive="false"/> +</value> +{% endhighlight %} +</div> + +</td><td> +<div markdown="1"> +{% highlight json %} +"quantity": { + "value": 500, + "comparator": ">", + "unit": "mg/dL", + "code": "mg/dL", + "system": "http://unitsofmeasure.org" +} +{% endhighlight %} +</div> + +</td></tr> +<tr><td colspan="2"> </td></tr> +<tr><th>CDA IVL_PQ Value - Low and High with Numeric Values</th><th>FHIR Range</th></tr> +<tr><td> +<div markdown="1"> +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low value="200" unit="mg/dL"/> + <high value="1000" unit="mg/dL"/> +</value> +{% endhighlight %} +</div> + +</td><td> +<div markdown="1"> +{% highlight json %} +"range": { + "low": { + "value": 200, + "unit": "mg/dL", + "code": "mg/dL", + "system": "http://unitsofmeasure.org" + }, + "high": { + "value": 1000, + "unit": "mg/dL", + "code": "mg/dL", + "system": "http://unitsofmeasure.org" + } +} +{% endhighlight %} +</div> + +</td></tr> +<tr><td> +<div markdown="1"> +Units can be different, as long as they are equivalent: + +{% highlight xml %} +<value xsi:type="IVL_PQ"> + <low value="200" unit="mg/dL"/> + <high value="1" unit="g/dL"/> +</value> +{% endhighlight %} +</div> + +</td><td> +<div markdown="1"> +{% highlight json %} +"range": { + "low": { + "value": 200, + "unit": "mg/dL", + "code": "mg/dL", + "system": "http://unitsofmeasure.org" + }, + "high": { + "value": 1, + "unit": "g/dL", + "code": "g/dL", + "system": "http://unitsofmeasure.org" + } +} +{% endhighlight %} +</div> + +</td></tr> +</table> + + ### CDA ↔ FHIR Provenance CDA provides a repeated set of elements within each activity which may be used in populating data to/from FHIR [Provenance.Agent](https://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-provenance.html) @@ -308,7 +538,7 @@ The mappings of name, address and telecom information are useful in many part of |CDA telecom|FHIR telecom|Transform Steps |:-----|:-----|:--------- |@use|.use|[CDA telecom use → FHIR contact point use](./ConceptMap-CF-TelecomUse.html)<br/>Note that CDA's `@use='PG'` is equivalent to FHIR's `.system='pager'`| -|@value|.system<br/>&<br/>.value|[CDA telecom value → FHIR contact point system](./ConceptMap-CF-TelecomType.html)<br/>Only include information in FHIR value which comes after the CDA system prefix| +|@value|.system<br/>&<br/>.value|[CDA telecom value → FHIR contact point system](./ConceptMap-CF-TelecomType.html)<br/>Only include information in FHIR value which comes after the CDA system prefix; other formatting may be preserved. E.g. CDA `tel:+1(555)867-5309` becomes `+1(555)867-5309` in FHIR.<br/>| #### FHIR name → CDA name ##### @@ -339,8 +569,8 @@ The mappings of name, address and telecom information are useful in many part of |FHIR telecom|CDA telecom|Comments |:-----|:-----|:--------- -|.system<br/>&<br/>.value |@value|[FHIR contact point system → CDA telecom value](./ConceptMap-FC-TelecomType.html)<br/>Insert FHIR value after the CDA system prefix mapped from FHIR system<br/>Note that FHIR's `.system='pager'` is equivalent to CDA's `@use='PG'` | |.use|@use|[FHIR contact point use → CDA use](./ConceptMap-FC-TelecomUse.html)| +|.system<br/>&<br/>.value |@value|[FHIR contact point system → CDA telecom value](./ConceptMap-FC-TelecomType.html)<br/>Insert FHIR value after the CDA system prefix mapped from FHIR system<br/>Note that FHIR's `.system='pager'` is equivalent to CDA's `@use='PG'` | ### Missing Data in C-CDA vs. FHIR ####