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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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)).
### 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) effectiveTime/high should not be mapped within onset (DateTime or Period)|
|/value|.type & .category|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) [CDA value → FHIR type](ConceptMap-CF-AllergyIntoleranceType.html) [CDA value → FHIR category](./ConceptMap-CF-AllergyIntoleranceCategory.html)|
|/author|.recorder & **[Provenance](http://hl7.org/fhir/us/core/STU4/StructureDefinition-us-core-provenance.html)**|**Constraint:** Only map single CDA author to FHIR recorder [Guidance on CDA ↔ FHIR Provenance](mappingGuidance.html#cda--fhir-provenance)|
-|/author/time|.recorded|**Constraint:** Only map earliest author/time [CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)|
+|/author/time|.recordedDate|**Constraint:** Only map earliest author/time [CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)|
|/participant/participantRole/playingEntity/code|.code|**Constraint:** When CDA negation is absent or false [CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)|
|/participant/participantRole/playingEntity/code & /value|.code|**Constraint:** When CDA negation is true and nullFlavor is used in playingEntity/code [CDA No known allergy → FHIR code](ConceptMap-CF-NoKnownAllergies.html) 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)** /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)** /entryRelationship/act[code/@code="48767-8"]/text³|**[Annotation](https://hl7.org/fhir/datatypes.html#Annotation)** .note||
-1\. XPath abbrievated for C-CDA Allergy Concern act as: ClinicalDocument/component/structuredBody/component/section[code/@code="48765-2"]/entry/act/
+1\. XPath abbreviated for C-CDA Allergy Concern act as: ClinicalDocument/component/structuredBody/component/section[code/@code="48765-2"]/entry/act/
-2\. XPath abbrievated for C-CDA Allergy Inteolerance observation as: 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: 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 @@
+
+
+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 `` 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 ``), it should be converted to the same FHIR resource.
+
+### C-CDA Encounter to FHIR
+(b) - indicates element is only present in Encounter Activity in the body of the document (h) - indicates element is only present in EncompassingEncounter in the header of the document
+
+|C-CDA¹ [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 [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 ``. 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 [CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)
+|/statusCode (b)|.status|[CDA → FHIR encounter status](ConceptMap-CF-EncounterStatus.html) **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"`. 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 /effectiveTime/low/@value|.period.start|[CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)
+|/effectiveTime/high/@value|.period.end
+|/sdtc:dischargeDispositionCode (b) /dischargeDispositionCode (h)|.hospialization.dischargeDisposition|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)
+|/performer (b) /encounterParticipant (h)|.participant|*TODO: Mapping Guidance for general performers (Participant vs ParticipantRole vs Organization)*
+|/performer/sdtc:functionCode (b)|.participant.type|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)
+|/participant[@typeCode="LOC"] (b) /location (h)|.location
+|**[Indication](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-Indication.html)** (b) /entryRelationship[@typeCode="RSON"]/observation|.reasonCode or .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. [CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept)
+|**[Encounter Diagnosis](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-EncounterDiagnosis.html)** (b) /entryRelationship/act[code/@code="29308-4"]/observation|**[Encounter Diagnosis](https://hl7.org/fhir/us/core/StructureDefinition-us-core-condition-encounter-diagnosis.html)** & .diagnosis.condition|The observation maps identically to [CDA → FHIR Problems](./CF-problems.html). 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 `` 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¹ [Medication Activity substanceAdministration](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-MedicationActivity.html)|FHIR [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 [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 [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 [CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)|
-|**Periodic Frequency** /effectiveTime[operator="A" and xsi:type="PIVL_TS"] .../@institutionSpecified .../period/@value .../period/@unit|.dosageInstruction.timing.repeat.frequency .dosageInstruction.timing.repeat.period .dosageInstruction.timing.repeat.periodUnit|Compare: [C-CDA Common Medication Frequencies](http://cdasearch.hl7.org/examples/view/9588687865c0f945a326364a9449321690c7a7ef) and [FHIR Timing Data Type](http://hl7.org/fhir/R4/datatypes.html#Timing)
+|**Periodic Frequency** /effectiveTime[operator="A" and xsi:type="PIVL_TS"] .../@institutionSpecified .../period/@value .../period/@unit|.dosageInstruction.timing.repeat.frequency .dosageInstruction.timing.repeat.period .dosageInstruction.timing.repeat.periodUnit|Compare: [C-CDA Common Medication Frequencies](http://cdasearch.hl7.org/examples/view/9588687865c0f945a326364a9449321690c7a7ef) and [FHIR Timing Data Type](http://hl7.org/fhir/R4/datatypes.html#Timing) to determine whether `frequency` or `period` should be used. 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** /effectiveTime[operator="A" and xsi:type="EIVL_TS"] .../event/@code .../offset|.dosageInstruction.timing.repeat.when .dosageInstruction.timing.repeat.offset|@code vocabulary matches .when 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 OR .medicationReference|[CDA coding ↔ FHIR CodeableConcept](mappingGuidance.html#cda-coding--fhir-codeableconcept) 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 & **[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. [CDA ↔ FHIR Time/Dates](mappingGuidance.html#cda--fhir-timedates)|
-|/precondition|.asNeededBoolean = true|The presence of a precondition element indicates asNeededBoolean should be true. More complex maps may be possible with .asNeededCodeableConcept.|
+|**[Drug Vehicle](https://hl7.org/cda/us/ccda/StructureDefinition-DrugVehicle.html)** /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)** /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)** /entryRelationship/substanceAdministration[code/@code="76662-6"]/text|.dosageInstruction.text||
|**[Instruction Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-Instruction.html)** /entryRelationship[@typeCode="SUBJ" and @inversionInd="true"]/act|.dosageInstruction.patientInstruction .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)** /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) `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)** /entryRelationship/act[code/@code="48767-8"]/text|**[Annotation](https://hl7.org/fhir/datatypes.html#Annotation)** .note||
+|/precondition|.asNeededBoolean = true|The presence of a precondition element indicates asNeededBoolean should be true. More complex maps may be possible with .asNeededCodeableConcept.|
1\. XPath abbrievated for C-CDA Medication Activity as: 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¹ [Medication Activity substanceAdministration](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-MedicationActivity.html)|FHIR [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)** .manufacturer|
+|**[Drug Vehicle](https://hl7.org/cda/us/ccda/StructureDefinition-DrugVehicle.html)** /participant[@typeCode="COV"]/playingEntity/code|.ingredient.itemCodeableConcept|Set `.isActive = false` [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 @@
+
+
+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 `` with a `` value of `34109-9`.
+
+### C-CDA to FHIR
+
+|C-CDA¹ [Note Activity](https://hl7.org/cda/us/ccda/2024Jan/StructureDefinition-NoteActivity.html) [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) **NOTE:** The root code in CDA is always `34109-9: Note` which matches the FHIR Binding.
+|/text/@mediaType & /text/text()|.attachment.contentType & .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 & .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. If the narrative has minimal markup (i.e. only `` and `` elements which can be converted to line breaks), it can be converted to `text/plain`. 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 or Parent `` element or ``|.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 ``, 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 @@
+
+
+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) (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) / [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) (ClinicalDocument)|[Participant](https://hl7.org/cda/stds/core/2.0.0-sd/StructureDefinition-Participant2.html) (Everywhere Else)|
+|:----|:----|:----|:----|:----|:----|
+|`@typeCode=AUT`|`@typeCode=ENT`|`@typeCode=INF`|`@typeCode=PRF`|@typeCode|@typeCode
+|functionCode|||sdtc:functionCode (no sdtc: in ServiceEvent)|functionCode|sdtc:functionCode
+|time|time||time|time|time
+||||modeCode (not in serviceEvent)||awarenessCode
+|**assignedAuthor**|**assignedEntity**|**assignedEntity** or **relatedEntity**|**assignedEntity**|**associatedEntity**|**participantRole**
+|`/@classCode=ASSIGNED`|`/@classCode=ASSIGNED`|/@classCode (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** or /**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** (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 `` 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 `` and `