Abstract Element: EncounterOrEpisode
Based on: DomainResource
[...]
1..1 SubjectOfRecord is type PatientSubjectOfRecord // EpisodeOfCare restricted in v2 (otherwise could be Patient or Group)
EntryElement: Encounter
Based on: EncounterOrEpisode
Encounter maps to Encounter:
[...]
SubjectOfRecord maps to patient
Element: PatientSubjectOfRecord
Based on: ObservationSubjectOfRecord
Value: ref(Patient)
Generated FHIR profile:
{
"path": "Encounter.patient",
"short": "The patient present at the encounter",
"definition": "The patient present at the encounter.",
"comments": "While the encounter is always about the patient, the patient may not actually be known in all contexts of use.",
"alias": [
"patient"
],
"min": 1,
"max": "1",
"type": [
{
"code": "Reference",
"profile": [
"http://hl7.org/fhir/us/shr/DSTU2/StructureDefinition/shr-core-Patient"
]
}
],
"isSummary": true,
"mapping": [
{
"identity": "v2",
"map": "PID-3"
},
{
"identity": "rim",
"map": ".participation[typeCode=SBJ]/role[classCode=PAT]"
},
{
"identity": "w5",
"map": "who.focus"
},
{
"identity": "shr",
"map": "<shr.core.PatientSubjectOfRecord>"
}
],
"id": "Encounter.patient",
"base": {
"path": "Encounter.patient",
"min": 0,
"max": "1"
}
},
The issue here is that subjectOfRecord is getting populated with a Patient object, when it should be populated with a PersonSubjectOfRecord object where the value is a ref(Patient). It's unclear how often this occurs across the spec
Observed using mCODE 0.9 spec:
Definition of Encounter:
Generated FHIR profile:
Resulting ES6 class fromFHIR method:
The issue here is that
subjectOfRecord
is getting populated with aPatient
object, when it should be populated with aPersonSubjectOfRecord
object where thevalue
is aref(Patient)
. It's unclear how often this occurs across the spec