diff --git a/data/Templates/Stu3ToR4/Account.liquid b/data/Templates/Stu3ToR4/Account.liquid new file mode 100644 index 000000000..2d50bd917 --- /dev/null +++ b/data/Templates/Stu3ToR4/Account.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "servicePeriod" : {{msg.period | to_json_string | default : '""'}}, + "balance" : "", + "active" : "", + "period" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ActivityDefinition.liquid b/data/Templates/Stu3ToR4/ActivityDefinition.liquid new file mode 100644 index 000000000..90d4c0563 --- /dev/null +++ b/data/Templates/Stu3ToR4/ActivityDefinition.liquid @@ -0,0 +1,40 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "author" :[ + {% for c in msg.contributor %} + {% if c.type == 'author' -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "editor" :[ + {% for c in msg.contributor %} + {% if c.type == "editor" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "reviewer" :[ + {% for c in msg.contributor %} + {% if c.type == "reviewer" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "endorser" :[ + {% for c in msg.contributor %} + {% if c.type == "endorser" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "kind" : {% include 'ActivityDefinition/TranslateKindCode' msg : msg.kind -%}, + "relatedArtifact" : [ {{ msg.relatedArtifact | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ], + "dosage" : [ {{ msg.dosage | to_array | batch_render: 'DataType/Dosage', 'msg' }} ], + "library" : [ {{ msg.library | to_array | batch_render: 'DataType/ReferenceToCanonical', 'msg' }} ], + "transform" : {% include 'DataType/ReferenceToCanonical' msg: msg.transform -%}, + "dynamicValue" : [ {{ msg.dynamicValue | to_array | batch_render: 'ActivityDefinition/ActivityDefinitionDynamicValue', 'msg' }} ], + "contributor" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ActivityDefinition/_ActivityDefinitionDynamicValue.liquid b/data/Templates/Stu3ToR4/ActivityDefinition/_ActivityDefinitionDynamicValue.liquid new file mode 100644 index 000000000..e2af1ae31 --- /dev/null +++ b/data/Templates/Stu3ToR4/ActivityDefinition/_ActivityDefinitionDynamicValue.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "expression" : { + "description" : "{{msg.description}}", + "language" : "{{msg.language}}", + "expression" : "{{msg.expression}}" + }, + "language" : "", + "description" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/ActivityDefinition/_TranslateKindCode.liquid b/data/Templates/Stu3ToR4/ActivityDefinition/_TranslateKindCode.liquid new file mode 100644 index 000000000..de8a210f4 --- /dev/null +++ b/data/Templates/Stu3ToR4/ActivityDefinition/_TranslateKindCode.liquid @@ -0,0 +1,8 @@ +{% case msg -%} + {% when "ProcedureRequest" -%} + "ServiceRequest" + {% when "ReferralRequest" -%} + "ServiceRequest" + {% else -%} + "{{msg}}" +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Address.liquid b/data/Templates/Stu3ToR4/Address.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Address.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AdverseEvent.liquid b/data/Templates/Stu3ToR4/AdverseEvent.liquid new file mode 100644 index 000000000..10e977ab1 --- /dev/null +++ b/data/Templates/Stu3ToR4/AdverseEvent.liquid @@ -0,0 +1,26 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "category" : [ + {%if msg.category -%} + { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/adverse-event-category", + "code" : "{{msg.category}}" + } + }, + {% endif -%} + ], + "event" : {{msg.type | to_json_string | default : '""'}}, + {% if msg.type == null -%} + "event" : { + "text" : "{{msg.description}}" + }, + {% endif -%} + "suspectEntity" : [ {{ msg.suspectEntity | to_array | batch_render: 'AdverseEvent/AdverseEventSuspectEntity', 'msg' }} ], + "eventParticipant" : "", + "reaction" : "", + "type" : "", + "description" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AdverseEvent/_AdverseEventSuspectEntity.liquid b/data/Templates/Stu3ToR4/AdverseEvent/_AdverseEventSuspectEntity.liquid new file mode 100644 index 000000000..acc310b2d --- /dev/null +++ b/data/Templates/Stu3ToR4/AdverseEvent/_AdverseEventSuspectEntity.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "causalityResult" : "", + "causalityAuthor" : "", + "causalityMethod" : "", + "causalityProductRelatedness" : "", + "causalityAssessment" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AllergyIntolerance.liquid b/data/Templates/Stu3ToR4/AllergyIntolerance.liquid new file mode 100644 index 000000000..02df753a5 --- /dev/null +++ b/data/Templates/Stu3ToR4/AllergyIntolerance.liquid @@ -0,0 +1,26 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "clinicalStatus" : "", + "verificationStatus" : "", + {%if msg.clinicalStatus -%} + "clinicalStatus" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical", + "code" : "{{msg.clinicalStatus}}" + } + }, + {% endif -%} + {%if msg.verificationStatus -%} + "verificationStatus" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification", + "code" : "{{msg.verificationStatus}}" + } + }, + {% endif -%} + "recordedDate" : "{{msg.assertedDate | date: "yyyy-MM-ddTHH:mm:ss.fff%K" }}", + "assertedDate" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/Appointment.liquid b/data/Templates/Stu3ToR4/Appointment.liquid new file mode 100644 index 000000000..1e8b2c8e0 --- /dev/null +++ b/data/Templates/Stu3ToR4/Appointment.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "reasonCode" : {{msg.reason | to_json_string | default : '""'}}, + "reasonReference" : {{msg.indication | to_json_string | default : '""'}}, + "basedOn" : {{msg.incomingReferral | to_json_string | default : '""'}}, + "incomingReferral" : "", + "indication" : "", + "reason" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AppointmentResponse.liquid b/data/Templates/Stu3ToR4/AppointmentResponse.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/AppointmentResponse.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AuditEvent.liquid b/data/Templates/Stu3ToR4/AuditEvent.liquid new file mode 100644 index 000000000..b8b2af068 --- /dev/null +++ b/data/Templates/Stu3ToR4/AuditEvent.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "agent" : [ {{ msg.agent | to_array | batch_render: 'AuditEvent/AuditEventAgent', 'msg' }} ], + "source" : {% include 'AuditEvent/AuditEventSource' msg: msg.source -%}, + "entity" : [ {{ msg.entity | to_array | batch_render: 'AuditEvent/AuditEventEntity', 'msg' }} ] +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/AuditEvent/_AuditEventAgent.liquid b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventAgent.liquid new file mode 100644 index 000000000..9c69ec773 --- /dev/null +++ b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventAgent.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "who" : {{msg.reference | to_json_string | default : '""'}}, + "who" : {% include 'DataType/IdentifierToReference' msg: msg.userId -%}, + "userId" : "", + "reference" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AuditEvent/_AuditEventEntity.liquid b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventEntity.liquid new file mode 100644 index 000000000..a10edb629 --- /dev/null +++ b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventEntity.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "what" : {% include 'DataType/IdentifierToReference' msg: msg.identifier -%}, + "what" : {{msg.reference | to_json_string | default : '""'}}, + "detail" : [ {{ msg.detail | to_array | batch_render: 'AuditEvent/AuditEventEntityDetail', 'msg' }} ], + "reference" : "", + "identifier" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AuditEvent/_AuditEventEntityDetail.liquid b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventEntityDetail.liquid new file mode 100644 index 000000000..cad43244f --- /dev/null +++ b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventEntityDetail.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "valueBase64Binary" : "{{msg.value}}", + "value":"" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/AuditEvent/_AuditEventSource.liquid b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventSource.liquid new file mode 100644 index 000000000..6f6429730 --- /dev/null +++ b/data/Templates/Stu3ToR4/AuditEvent/_AuditEventSource.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "observer" : {% include 'DataType/IdentifierToReference' msg: msg.identifier -%}, + "identifier" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Basic.liquid b/data/Templates/Stu3ToR4/Basic.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Basic.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Binary.liquid b/data/Templates/Stu3ToR4/Binary.liquid new file mode 100644 index 000000000..687ff01f5 --- /dev/null +++ b/data/Templates/Stu3ToR4/Binary.liquid @@ -0,0 +1,7 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "data" : "{{msg.content}}", + "content" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/BodySite.liquid b/data/Templates/Stu3ToR4/BodySite.liquid new file mode 100644 index 000000000..f55a3ff9e --- /dev/null +++ b/data/Templates/Stu3ToR4/BodySite.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "resourceType":"BodyStructure", + "location" : {{msg.code | to_json_string | default : '""'}}, + "locationQualifier" : {{msg.qualifier | to_json_string | default : '""'}}, + "qualifier" : "", + "code" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/Bundle.liquid b/data/Templates/Stu3ToR4/Bundle.liquid new file mode 100644 index 000000000..84795968c --- /dev/null +++ b/data/Templates/Stu3ToR4/Bundle.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "entry" : [ {{ msg.entry | to_array | batch_render: 'Bundle/Entry', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Bundle/_Entry.liquid b/data/Templates/Stu3ToR4/Bundle/_Entry.liquid new file mode 100644 index 000000000..5aec020be --- /dev/null +++ b/data/Templates/Stu3ToR4/Bundle/_Entry.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "resource": {% include 'Resource' msg : msg.resource -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CapabilityStatement.liquid b/data/Templates/Stu3ToR4/CapabilityStatement.liquid index 2ae8f5631..3f05f9a6b 100644 --- a/data/Templates/Stu3ToR4/CapabilityStatement.liquid +++ b/data/Templates/Stu3ToR4/CapabilityStatement.liquid @@ -1,6 +1,10 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} {%if msg.acceptUnknown -%} { "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-CapabilityStatement.acceptUnknown", @@ -8,6 +12,7 @@ }, {% endif -%} ], + "fhirVersion": "4.0.1", "profile" : "", "rest" : [ {{ msg.rest | to_array | batch_render: 'CapabilityStatement/Rest', 'msg' }} ], "messaging" : [ {{ msg.messaging | to_array | batch_render: 'CapabilityStatement/Messaging', 'msg' }} ], diff --git a/data/Templates/Stu3ToR4/CapabilityStatement/_Document.liquid b/data/Templates/Stu3ToR4/CapabilityStatement/_Document.liquid index f003800da..9caf4f24b 100644 --- a/data/Templates/Stu3ToR4/CapabilityStatement/_Document.liquid +++ b/data/Templates/Stu3ToR4/CapabilityStatement/_Document.liquid @@ -1,5 +1,5 @@ {% mergeDiff msg -%} { - "profile" : {% include 'Shared/ReferenceToCanonical' msg: msg.profile -%} + "profile" : {% include 'DataType/ReferenceToCanonical' msg: msg.profile -%} } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CapabilityStatement/_Resource.liquid b/data/Templates/Stu3ToR4/CapabilityStatement/_Resource.liquid index f003800da..9caf4f24b 100644 --- a/data/Templates/Stu3ToR4/CapabilityStatement/_Resource.liquid +++ b/data/Templates/Stu3ToR4/CapabilityStatement/_Resource.liquid @@ -1,5 +1,5 @@ {% mergeDiff msg -%} { - "profile" : {% include 'Shared/ReferenceToCanonical' msg: msg.profile -%} + "profile" : {% include 'DataType/ReferenceToCanonical' msg: msg.profile -%} } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CapabilityStatement/_Rest.liquid b/data/Templates/Stu3ToR4/CapabilityStatement/_Rest.liquid index 1d182df43..6dedca6a3 100644 --- a/data/Templates/Stu3ToR4/CapabilityStatement/_Rest.liquid +++ b/data/Templates/Stu3ToR4/CapabilityStatement/_Rest.liquid @@ -3,4 +3,4 @@ "security" : {% include 'CapabilityStatement/Security' msg: msg.security -%}, "resource" : [ {{ msg.resource | to_array | batch_render: 'CapabilityStatement/Resource', 'msg' }} ] } -{% endmergeDiff -%} \ No newline at end of file +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/CapabilityStatement/_SupportedMessage.liquid b/data/Templates/Stu3ToR4/CapabilityStatement/_SupportedMessage.liquid index 94a1ae6c2..581796348 100644 --- a/data/Templates/Stu3ToR4/CapabilityStatement/_SupportedMessage.liquid +++ b/data/Templates/Stu3ToR4/CapabilityStatement/_SupportedMessage.liquid @@ -1,5 +1,5 @@ {% mergeDiff msg -%} { - "definition" : {% include 'Shared/ReferenceToCanonical' msg: msg.definition -%} + "definition" : {% include 'DataType/ReferenceToCanonical' msg: msg.definition -%} } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CarePlan.liquid b/data/Templates/Stu3ToR4/CarePlan.liquid new file mode 100644 index 000000000..5bb43dc6d --- /dev/null +++ b/data/Templates/Stu3ToR4/CarePlan.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "instantiatesCanonical" : {% include 'DataType/ReferenceToCanonical'' msg: msg.definition -%}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "activity" : [ {{ msg.activity | to_array | batch_render: 'CarePlan/Activity', 'msg' }} ], + "context" : "", + "definition" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CarePlan/_Activity.liquid b/data/Templates/Stu3ToR4/CarePlan/_Activity.liquid new file mode 100644 index 000000000..6ef760087 --- /dev/null +++ b/data/Templates/Stu3ToR4/CarePlan/_Activity.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "detail" : {% include 'CarePlan/Detail' msg: msg.detail -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CarePlan/_Detail.liquid b/data/Templates/Stu3ToR4/CarePlan/_Detail.liquid new file mode 100644 index 000000000..623d5ccff --- /dev/null +++ b/data/Templates/Stu3ToR4/CarePlan/_Detail.liquid @@ -0,0 +1,25 @@ +{% mergeDiff msg -%} +{ + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.category -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-CarePlan.activity.detail.category", + "valueCodeableConcept" : {{msg.category | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "instantiatesCanonical" : [ + {{msg.definition | to_json_string | default : '""'}} + ], + "statusReason" : { + "text" : "{{msg.statusReason}}" + }, + "doNotPerform" : "{{msg.prohibited}}", + "prohibited" : "", + "definition" : "", + "category" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CareTeam.liquid b/data/Templates/Stu3ToR4/CareTeam.liquid new file mode 100644 index 000000000..80c97e2d7 --- /dev/null +++ b/data/Templates/Stu3ToR4/CareTeam.liquid @@ -0,0 +1,7 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "context" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ChargeItem.liquid b/data/Templates/Stu3ToR4/ChargeItem.liquid new file mode 100644 index 000000000..1c203c040 --- /dev/null +++ b/data/Templates/Stu3ToR4/ChargeItem.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "definitionUri" : {{msg.definition | to_json_string | default : '""'}}, + "performer" : [ {{ msg.participant | to_array | batch_render: 'ChargeItem/ChargeItemPerformer', 'msg' }} ], + "priceOverride" : {% include 'DataType/Money' msg: msg.priceOverride -%}, + "participant" : "", + "definition" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/ChargeItem/_ChargeItemPerformer.liquid b/data/Templates/Stu3ToR4/ChargeItem/_ChargeItemPerformer.liquid new file mode 100644 index 000000000..aa9e1b726 --- /dev/null +++ b/data/Templates/Stu3ToR4/ChargeItem/_ChargeItemPerformer.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "function" : {{msg.role | to_json_string | default : '""'}}, + "role" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Claim.liquid b/data/Templates/Stu3ToR4/Claim.liquid new file mode 100644 index 000000000..a1856ed6b --- /dev/null +++ b/data/Templates/Stu3ToR4/Claim.liquid @@ -0,0 +1,68 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "use" : {% include 'Claim/TranslateUseCode' msg : msg.use -%}, + {% if msg.provider == null -%} + "provider" : {{msg.organization | to_json_string | default : '""'}}, + {% endif -%} + "payee" : + {% mergeDiff msg.payee %} + { + "resourceType" : "" + } + {% endmergeDiff %}, + "supportingInfo" : {{msg.information | to_json_string | default : '""'}}, + "item" : [ + {% for i in msg.item %} + {% mergeDiff i %} + { + "careTeamSequence" : {{i.careTeamLinkId | to_json_string | default : '""'}}, + "diagnosisSequence" : {{i.diagnosisLinkId | to_json_string | default : '""'}}, + "procedureSequence" : {{i.procedureLinkId | to_json_string | default : '""'}}, + "informationSequence" : {{i.informationLinkId | to_json_string | default : '""'}}, + "productOrService" : {{i.service | to_json_string | default : '""'}}, + "diagnosisCodeableConcept" : {{i.locationCodeableConcept | to_json_string | default : '""'}}, + "careTeamLinkId" : "", + "diagnosisLinkId" : "", + "procedureLinkId" : "", + "informationLinkId" : "", + "service": "", + "locationCodeableConcept" : "", + "unitPrice" : {% include 'DataType/Money' msg: i.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: i.net -%}, + "detail" : [ + {% for d in i.detail %} + {% mergeDiff d %} + { + "productOrService" : {{d.service | to_json_string | default : '""'}}, + "unitPrice" : {% include 'DataType/Money' msg: d.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: d.net -%}, + "service": "", + "subDetail" : [ + {% for s in d.subDetail %} + {% mergeDiff s %} + { + "productOrService" : {{s.service | to_json_string | default : '""'}}, + "unitPrice" : {% include 'DataType/Money' msg: s.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: s.net -%}, + "service": "" + } + {% endmergeDiff %}, + {% endfor %} + ] + } + {% endmergeDiff %}, + {% endfor %} + ] + } + {% endmergeDiff %}, + {% endfor %} + ], + "total" : {% include 'DataType/Money' msg: msg.total -%}, + "hospitalization" : "", + "employmentImpacted" : "", + "information" : "", + "organization" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/Claim/_TranslateUseCode.liquid b/data/Templates/Stu3ToR4/Claim/_TranslateUseCode.liquid new file mode 100644 index 000000000..aa04efc2e --- /dev/null +++ b/data/Templates/Stu3ToR4/Claim/_TranslateUseCode.liquid @@ -0,0 +1,8 @@ +{% case msg -%} + {% when "complete" -%} + "claim" + {% when "proposed" -%} + "preauthorization" + {% when "exploratory" -%} + "predetermination" +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse.liquid b/data/Templates/Stu3ToR4/ClaimResponse.liquid new file mode 100644 index 000000000..c9796b721 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse.liquid @@ -0,0 +1,32 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "requestor" : {{msg.requestProvider | to_json_string | default : '""'}}, + {% assign value = msg.outcome.coding[0].code %} + {% if value == 'queued' or value =='complete' or value =='error' or value == 'partial' -%} + "outcome" : "{{value}}", + {% else %} + "outcome" : "", + {% endif -%} + "item" : [ {{ msg.item | to_array | batch_render: 'ClaimResponse/ClaimResponseItem', 'msg' }} ], + "addItem" : [ {{ msg.addItem | to_array | batch_render: 'ClaimResponse/ClaimResponseAddItem', 'msg' }} ], + "error" : [ {{ msg.error | to_array | batch_render: 'ClaimResponse/ClaimResponseError', 'msg' }} ], + "total" : [ + {% include 'ClaimResponse/ClaimResponseTotalCost' msg: msg.totalCost -%}, + {% include 'ClaimResponse/ClaimResponseTotalBenefit' msg: msg.totalBenefit -%} + ], + "payment" : {% include 'ClaimResponse/ClaimResponsePayment' msg: msg.payment -%}, + "fundsReserve" : { + "coding" : {{msg.reserved | to_json_string | default : '""' }} + }, + "form" : {% include 'DataType/CodeableConceptToAttachment' msg: msg.form -%}, + "processNote" : [ {{ msg.processNote | to_array | batch_render: 'ClaimResponse/ClaimResponseProcessNote', 'msg' }} ], + "insurance" : [ {{ msg.insurance | to_array | batch_render: 'ClaimResponse/ClaimResponseInsurance', 'msg' }} ], + "totalBenefit" : "", + "unallocDeductable" : "", + "totalCost" : "", + "requestOrganization" : "", + "requestProvider" : "", + "reserved" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseAddItem.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseAddItem.liquid new file mode 100644 index 000000000..52b5b80ea --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseAddItem.liquid @@ -0,0 +1,12 @@ +{% mergeDiff msg -%} +{ + "itemSequence" : "{{msg.sequenceLinkId}}", + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ClaimResponseItemAdjudication', 'msg' }} ], + "detail" : [ {{ msg.detail | to_array | batch_render: 'ClaimResponse/ClaimResponseAddItemDetail', 'msg' }} ], + "fee" : "", + "service" : "", + "category" : "", + "revenue" : "", + "sequenceLinkId" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseAddItemDetail.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseAddItemDetail.liquid new file mode 100644 index 000000000..a86c6e0ae --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseAddItemDetail.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ClaimResponseItemAdjudication', 'msg' }} ], + "fee" : "", + "service" : "", + "category" : "", + "revenue" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseError.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseError.liquid new file mode 100644 index 000000000..7803859df --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseError.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "itemSequence" : "{{msg.sequenceLinkId}}", + "detailSequence" : "{{msg.detailSequenceLinkId}}", + "subDetailSequence" : "{{msg.subdetailSequenceLinkId}}", + "subdetailSequenceLinkId" : "", + "detailSequenceLinkId" : "", + "sequenceLinkId" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseInsurance.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseInsurance.liquid new file mode 100644 index 000000000..34e955df2 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseInsurance.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "preAuthRef" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItem.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItem.liquid new file mode 100644 index 000000000..e26496a48 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItem.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "itemSequence" : "{{msg.sequenceLinkId}}", + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: 'ClaimResponse/ClaimResponseItemAdjudication', 'msg' }} ], + "detail" : [ {{ msg.detail | to_array | batch_render: 'ClaimResponse/ClaimResponseItemDetail', 'msg' }} ], + "sequenceLinkId" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemAdjudication.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemAdjudication.liquid new file mode 100644 index 000000000..58ce319e9 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemAdjudication.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "amount" : {% include 'DataType/Money' msg: msg.amount -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemDetail.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemDetail.liquid new file mode 100644 index 000000000..26fda85d3 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemDetail.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "detailSequence" : "{{msg.sequenceLinkId}}", + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ClaimResponseItemAdjudication', 'msg' }} ], + "subDetail" : [ {{ msg.subDetail | to_array | batch_render: 'ClaimResponse/ClaimResponseItemDetailSubDetail', 'msg' }} ], + "sequenceLinkId" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemDetailSubDetail.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemDetailSubDetail.liquid new file mode 100644 index 000000000..17c4c527c --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseItemDetailSubDetail.liquid @@ -0,0 +1,7 @@ +{% mergeDiff msg -%} +{ + "subDetailSequence" : "{{msg.sequenceLinkId}}", + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ClaimResponseItemAdjudication', 'msg' }} ], + "sequenceLinkId" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponsePayment.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponsePayment.liquid new file mode 100644 index 000000000..e89086eb0 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponsePayment.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "adjustment" : {% include 'DataType/Money' msg: msg.adjustment -%}, + "amount" : {% include 'DataType/Money' msg: msg.amount -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseProcessNote.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseProcessNote.liquid new file mode 100644 index 000000000..5c111b5ed --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseProcessNote.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "type" : {% include 'DataType/CodeableConceptToCode' msg: msg.type -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseTotalBenefit.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseTotalBenefit.liquid new file mode 100644 index 000000000..34e4670c3 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseTotalBenefit.liquid @@ -0,0 +1,10 @@ +{ + "category" : { + "text" : "Benefit Amount", + "coding" : { + "code" : "benefit", + "system" : "http://terminology.hl7.org/CodeSystem/adjudication" + } + }, + "amount" : {% include 'DataType/Money' msg: msg -%} +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseTotalCost.liquid b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseTotalCost.liquid new file mode 100644 index 000000000..5a529860e --- /dev/null +++ b/data/Templates/Stu3ToR4/ClaimResponse/_ClaimResponseTotalCost.liquid @@ -0,0 +1,11 @@ +{ + "category" : { + "text" : "Submitted Amount", + "coding" : { + "code" : "submitted", + "system" : "http://terminology.hl7.org/CodeSystem/adjudication" + } + }, + "amount" : {% include 'DataType/Money' msg: msg -%} +} + diff --git a/data/Templates/Stu3ToR4/ClinicalImpression.liquid b/data/Templates/Stu3ToR4/ClinicalImpression.liquid new file mode 100644 index 000000000..ff3336390 --- /dev/null +++ b/data/Templates/Stu3ToR4/ClinicalImpression.liquid @@ -0,0 +1,20 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "status" : {% include 'ClinicalImpression/TranslateStatusCode' msg : msg.status -%}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "context" : "", + "extension":[ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {% if msg.action -%} + { + "url" : "http://hl7.org/fhir/3.0/StructureDefinition/extension-ClinicalImpression.action", + "valueReference" : {{msg.action | to_json_string | default : '""' }} + } + {% endif -%} + ], + "action" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/ClinicalImpression/_TranslateStatusCode.liquid b/data/Templates/Stu3ToR4/ClinicalImpression/_TranslateStatusCode.liquid new file mode 100644 index 000000000..f67a2960d --- /dev/null +++ b/data/Templates/Stu3ToR4/ClinicalImpression/_TranslateStatusCode.liquid @@ -0,0 +1,8 @@ +{% case msg -%} + {% when "draft" -%} + "in-progress" + {% when "completed" -%} + "completed" + {% when "entered-in-error" -%} + "entered-in-error" +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CodeSystem.liquid b/data/Templates/Stu3ToR4/CodeSystem.liquid index 2891bd9b0..6ef6ab0d7 100644 --- a/data/Templates/Stu3ToR4/CodeSystem.liquid +++ b/data/Templates/Stu3ToR4/CodeSystem.liquid @@ -1,5 +1,8 @@ {% mergeDiff msg -%} { - "concept" : [ {{ msg.concept | to_array | batch_render: 'CodeSystem/Concept', 'msg' }} ] + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [ + {{msg.identifier | to_json_string | default : '""'}} + ] } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CodeSystem/_Concept.liquid b/data/Templates/Stu3ToR4/CodeSystem/_Concept.liquid deleted file mode 100644 index 444d8dc64..000000000 --- a/data/Templates/Stu3ToR4/CodeSystem/_Concept.liquid +++ /dev/null @@ -1,5 +0,0 @@ -{% mergeDiff msg -%} -{ - "concept" : [ {{ msg.concept | to_array | batch_render: 'CodeSystem/concept', 'msg' }} ] -} -{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Communication.liquid b/data/Templates/Stu3ToR4/Communication.liquid new file mode 100644 index 000000000..2065fd083 --- /dev/null +++ b/data/Templates/Stu3ToR4/Communication.liquid @@ -0,0 +1,30 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "instantiatesCanonical" : {{msg.definition | to_json_string | default : '""'}}, + {% if msg.notDone -%} + "status" : "not-done", + {% else %} + "status" : "{{msg.status}}", + {% endif -%} + "statusReason" : {{msg.notDoneReason | to_json_string | default : '""'}}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {% for t in msg.topic -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Communication.topic", + "valueReference" : {{ t | to_json_string | default : '""' }} + }, + {% endfor -%} + ], + "notDoneReason" : "", + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "notDone" : "", + "definition" : "", + "topic" : "", + "context" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/CommunicationRequest.liquid b/data/Templates/Stu3ToR4/CommunicationRequest.liquid new file mode 100644 index 000000000..d2fc0f128 --- /dev/null +++ b/data/Templates/Stu3ToR4/CommunicationRequest.liquid @@ -0,0 +1,21 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "about" : {{msg.topic | to_json_string | default : '""'}}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.requester.onBehalfOf -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-CommunicationRequest.requester.onBehalfOf", + "valueReference" : {{msg.requester.onBehalfOf | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "requester" : {{msg.requester.agent | to_json_string | default : '""'}}, + "context" : "", + "topic" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CompartmentDefinition.liquid b/data/Templates/Stu3ToR4/CompartmentDefinition.liquid new file mode 100644 index 000000000..5aea19d3b --- /dev/null +++ b/data/Templates/Stu3ToR4/CompartmentDefinition.liquid @@ -0,0 +1,14 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "jurisdiction" : "", + "title" : "", + "resource" : [ + {% for r in mag.resource -%} + {% if r.code != "DeviceComponent" and r.code != "ImagingManifest" and r.code != "ServiceDefinition" -%} + {% include 'CompartmentDefinition/_CompartmentDefinitionResource' msg : r -%}, + {% endif -%} + {% endfor -%} + ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/CompartmentDefinition/__CompartmentDefinitionResource.liquid b/data/Templates/Stu3ToR4/CompartmentDefinition/__CompartmentDefinitionResource.liquid new file mode 100644 index 000000000..7b412cb50 --- /dev/null +++ b/data/Templates/Stu3ToR4/CompartmentDefinition/__CompartmentDefinitionResource.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "code" : {% include 'DataType/ResourceMapping' msg : msg.code -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Composition.liquid b/data/Templates/Stu3ToR4/Composition.liquid new file mode 100644 index 000000000..3a9f9dd5a --- /dev/null +++ b/data/Templates/Stu3ToR4/Composition.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "category" : [ + {{msg.class | to_json_string | default : '""'}} + ], + "class" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ConceptMap.liquid b/data/Templates/Stu3ToR4/ConceptMap.liquid new file mode 100644 index 000000000..799f4c662 --- /dev/null +++ b/data/Templates/Stu3ToR4/ConceptMap.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "sourceReference" : {% include 'DataType/ReferenceToCanonical' msg: msg.sourceReference -%}, + "targetReference" : {% include 'DataType/ReferenceToCanonical' msg: msg.targetReference -%}, + "group" : [ {{ msg.group | to_array | batch_render: 'ConceptMap/TheGroup', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ConceptMap/_Element.liquid b/data/Templates/Stu3ToR4/ConceptMap/_Element.liquid new file mode 100644 index 000000000..026753c38 --- /dev/null +++ b/data/Templates/Stu3ToR4/ConceptMap/_Element.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "target" : [ {{ msg.target | to_array | batch_render: 'ConceptMap/TheTarget', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ConceptMap/_Qualifier.liquid b/data/Templates/Stu3ToR4/ConceptMap/_Qualifier.liquid new file mode 100644 index 000000000..979365d6e --- /dev/null +++ b/data/Templates/Stu3ToR4/ConceptMap/_Qualifier.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "value" : "{{msg.code}}", + "code" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ConceptMap/_TheGroup.liquid b/data/Templates/Stu3ToR4/ConceptMap/_TheGroup.liquid new file mode 100644 index 000000000..b45351bcc --- /dev/null +++ b/data/Templates/Stu3ToR4/ConceptMap/_TheGroup.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "element" : [ {{ msg.element | to_array | batch_render: 'ConceptMap/Element', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ConceptMap/_TheTarget.liquid b/data/Templates/Stu3ToR4/ConceptMap/_TheTarget.liquid new file mode 100644 index 000000000..5b706994a --- /dev/null +++ b/data/Templates/Stu3ToR4/ConceptMap/_TheTarget.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "dependsOn" : [ {{ msg.dependsOn | to_array | batch_render: 'ConceptMap/Qualifier', 'msg' }} ], + "product" : [ {{ msg.product | to_array | batch_render: 'ConceptMap/Qualifier', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Condition.liquid b/data/Templates/Stu3ToR4/Condition.liquid new file mode 100644 index 000000000..e33298a9e --- /dev/null +++ b/data/Templates/Stu3ToR4/Condition.liquid @@ -0,0 +1,25 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + {%if msg.clinicalStatus -%} + "clinicalStatus" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/condition-clinical", + "code" : "{{msg.clinicalStatus}}" + } + }, + {% endif -%} + {%if msg.verificationStatus -%} + "verificationStatus" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/condition-ver-status", + "code" : "{{msg.verificationStatus}}" + } + }, + {% endif -%} + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "recordedDate" : "{{msg.assertedDate | date: "yyyy-MM-dd"}}", + "assertedDate" : "", + "context" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Consent.liquid b/data/Templates/Stu3ToR4/Consent.liquid new file mode 100644 index 000000000..6cab3299e --- /dev/null +++ b/data/Templates/Stu3ToR4/Consent.liquid @@ -0,0 +1,26 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "performer" : {{msg.consentingParty | to_json_string | default : '""'}}, + {%if msg.policyRule -%} + "policyRule" : { + "coding" : { + "system" : "urn:ietf:rfc:3986", + "code" : "{{msg.policyRule}}" + } + }, + {% endif -%} + {% if msg.securityLabel or msg.period or msg.actor or msg.action or msg.purpose or msg.dataPeriod or msg.data or msg.except -%} + "provision" : {% include 'Consent/Base' msg: msg %}, + {% endif -%} + "except" : "", + "data" : "", + "dataPeriod" : "", + "purpose" : "", + "securityLabel" : "", + "action" : "", + "actor" : "", + "consentingParty" : "", + "period" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/Consent/_Base.liquid b/data/Templates/Stu3ToR4/Consent/_Base.liquid new file mode 100644 index 000000000..0d0c95bf9 --- /dev/null +++ b/data/Templates/Stu3ToR4/Consent/_Base.liquid @@ -0,0 +1,10 @@ +{ + "period" : {{msg.period | to_json_string | default : '""' }}, + "actor" : {{msg.actor | to_json_string | default : '""'}}, + "action" : {{msg.action | to_json_string | default : '""'}}, + "securityLabel" : {{msg.securityLabel | to_json_string | default : '""'}}, + "purpose" : {{msg.purpose | to_json_string | default : '""'}}, + "dataPeriod" : {{msg.dataPeriod | to_json_string | default : '""'}}, + "data" : {{msg.data | to_json_string | default : '""'}}, + "provision" : [ {{ msg.except | to_array | batch_render: 'Consent/Provision', 'msg' }} ] +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Consent/_Provision.liquid b/data/Templates/Stu3ToR4/Consent/_Provision.liquid new file mode 100644 index 000000000..b2f304674 --- /dev/null +++ b/data/Templates/Stu3ToR4/Consent/_Provision.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg %} +{ + "code" : {% include 'DataType/CodingToCodeableConcept' msg:msg.code %} +} +{% endmergeDiff %} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Contract.liquid b/data/Templates/Stu3ToR4/Contract.liquid new file mode 100644 index 000000000..1ad6f5c60 --- /dev/null +++ b/data/Templates/Stu3ToR4/Contract.liquid @@ -0,0 +1,16 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [{{msg.identifier | to_json_string | default : '""'}}], + "term" : [ {{ msg.term | to_array | batch_render: 'Contract/ContractTerm', 'msg' }} ], + "signer" : [ {{ msg.signer | to_array | batch_render: 'Contract/ContractSigner', 'msg' }} ], + "binding[x]" : "", + "valuedItem" : "", + "agent" : "", + "securityLabel" : "", + "decisionType" : "", + "action" : "", + "actionReason" : "", + "topic" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Contract/_ContractSigner.liquid b/data/Templates/Stu3ToR4/Contract/_ContractSigner.liquid new file mode 100644 index 000000000..b50c4356c --- /dev/null +++ b/data/Templates/Stu3ToR4/Contract/_ContractSigner.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "signature" : [ {{ msg.signature | to_array | batch_render: 'DataType/Signature', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Contract/_ContractTerm.liquid b/data/Templates/Stu3ToR4/Contract/_ContractTerm.liquid new file mode 100644 index 000000000..12380e53b --- /dev/null +++ b/data/Templates/Stu3ToR4/Contract/_ContractTerm.liquid @@ -0,0 +1,21 @@ +{% mergeDiff msg -%} +{ + "asset" : [ + { + "valuedItem" : [ {{ msg.valuedItem | to_array | batch_render: 'Contract/ContractTermAssetValuedItem', 'msg' }} ] + } + ], + "securityLable":[ + {% for s in msg.securityLabel -%} + { + "classification" : {{ s | to_json_string | default : '""'}}, + }, + {% endfor -%} + ], + "group" : [ {{ msg.group | to_array | batch_render: 'Contract/ContractTerm', 'msg' }} ], + "actionReason" : "", + "topic" : "", + "action" : "", + "agent" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Contract/_ContractTermAssetValuedItem.liquid b/data/Templates/Stu3ToR4/Contract/_ContractTermAssetValuedItem.liquid new file mode 100644 index 000000000..ab49d6710 --- /dev/null +++ b/data/Templates/Stu3ToR4/Contract/_ContractTermAssetValuedItem.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "unitPrice" : {% include 'DataType/Money' msg: msg.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: msg.net -%} +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/Coverage.liquid b/data/Templates/Stu3ToR4/Coverage.liquid new file mode 100644 index 000000000..023482882 --- /dev/null +++ b/data/Templates/Stu3ToR4/Coverage.liquid @@ -0,0 +1,27 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "class" : [ + {% if msg.grouping.group -%} + {% include 'Coverage/CoverageGroupingGroup' msg: msg.grouping -%}, + {% endif -%} + {% if msg.grouping.subGroup -%} + {% include 'Coverage/CoverageGroupingSubGroup' msg: msg.grouping -%}, + {% endif -%} + {% if msg.grouping.plan -%} + {% include 'Coverage/CoverageGroupingPlan' msg: msg.grouping -%}, + {% endif -%} + {% if msg.grouping.subPlan -%} + {% include 'Coverage/CoverageGroupingSubPlan' msg: msg.grouping -%}, + {% endif -%} + {% if msg.grouping.class -%} + {% include 'Coverage/CoverageGroupingClass' msg: msg.grouping -%}, + {% endif -%} + {% if msg.grouping.subClass -%} + {% include 'Coverage/CoverageGroupingSubClass' msg: msg.grouping -%}, + {% endif -%} + ], + "sequence" : "", + "grouping" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingClass.liquid b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingClass.liquid new file mode 100644 index 000000000..6215d8056 --- /dev/null +++ b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingClass.liquid @@ -0,0 +1,10 @@ +{ + "type" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/coverage-class", + "code" : "class" + } + }, + "value" : "{{msg.class}}", + "name" : "{{msg.classDisplay}}" +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingGroup.liquid b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingGroup.liquid new file mode 100644 index 000000000..5053060fc --- /dev/null +++ b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingGroup.liquid @@ -0,0 +1,10 @@ +{ + "type" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/coverage-class", + "code" : "group" + } + }, + "value" : "{{msg.group}}", + "name" : "{{msg.groupDisplay}}" +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingPlan.liquid b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingPlan.liquid new file mode 100644 index 000000000..24828bfeb --- /dev/null +++ b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingPlan.liquid @@ -0,0 +1,10 @@ +{ + "type" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/coverage-class", + "code" : "plan" + } + }, + "value" : "{{msg.plan}}", + "name" : "{{msg.planDisplay}}" +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubClass.liquid b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubClass.liquid new file mode 100644 index 000000000..db3958e3d --- /dev/null +++ b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubClass.liquid @@ -0,0 +1,10 @@ +{ + "type" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/coverage-class", + "code" : "subclass" + } + }, + "value" : "{{msg.subClass}}", + "name" : "{{msg.subClassDisplay}}" +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubGroup.liquid b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubGroup.liquid new file mode 100644 index 000000000..25f46203d --- /dev/null +++ b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubGroup.liquid @@ -0,0 +1,10 @@ +{ + "type" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/coverage-class", + "code" : "subgroup" + } + }, + "value" : "{{msg.subGroup}}", + "name" : "{{msg.subGroupDisplay}}" +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubPlan.liquid b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubPlan.liquid new file mode 100644 index 000000000..5c6ffc78c --- /dev/null +++ b/data/Templates/Stu3ToR4/Coverage/_CoverageGroupingSubPlan.liquid @@ -0,0 +1,11 @@ +{ + "type" : { + "coding" : + { + "system" : "http://terminology.hl7.org/CodeSystem/coverage-class", + "code" : "subplan" + } + }, + "value" : "{{msg.subPlan}}", + "name" : "{{msg.subPlanDisplay}}", +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/DataRequirement/_CodeFilter.liquid b/data/Templates/Stu3ToR4/DataType/DataRequirement/_CodeFilter.liquid new file mode 100644 index 000000000..7aa1b4766 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/DataRequirement/_CodeFilter.liquid @@ -0,0 +1,19 @@ +{% mergeDiff msg -%} +{ + "valueSet[x]" : "", + "valueSet" : "{{msg.valueSetReference.reference}}", + "code" : [ + { + "code" : "{{msg.valueCode}}" + }, + {{msg.valueCoding | to_json_string | default : '""'}}, + {% for c in msg.valueCodeableConcept.coding -%} + {{c | to_json_string | default : '""'}}, + {% endfor -%} + ], + "code" : {{msg.valueCoding | to_json_string | default : '""'}}, + "valueCoding" : "", + "valueCode" : "", + "valueCodeableConcept" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_CodeableConceptToAttachment.liquid b/data/Templates/Stu3ToR4/DataType/_CodeableConceptToAttachment.liquid new file mode 100644 index 000000000..dc00d0da5 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_CodeableConceptToAttachment.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg %} +{ + +} +{% endmergeDiff %} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_CodeableConceptToCode.liquid b/data/Templates/Stu3ToR4/DataType/_CodeableConceptToCode.liquid new file mode 100644 index 000000000..af8e66dbd --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_CodeableConceptToCode.liquid @@ -0,0 +1,2 @@ +{% assign coding = msg.coding | first} +"{{coding.code}}" \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_CodingToCodeableConcept.liquid b/data/Templates/Stu3ToR4/DataType/_CodingToCodeableConcept.liquid new file mode 100644 index 000000000..a005badbf --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_CodingToCodeableConcept.liquid @@ -0,0 +1,5 @@ +[ + { + "coding" : {{msg | to_json_string | default : '""'}} + } +] \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_ContributorToContactDetail.liquid b/data/Templates/Stu3ToR4/DataType/_ContributorToContactDetail.liquid new file mode 100644 index 000000000..c5dc297e5 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_ContributorToContactDetail.liquid @@ -0,0 +1,3 @@ +{% for c in msg.contact -%} + {{ c |to_json_string | default : '""'}}, +{% endfor -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_DataRequirement.liquid b/data/Templates/Stu3ToR4/DataType/_DataRequirement.liquid new file mode 100644 index 000000000..7bb675152 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_DataRequirement.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "codeFilter" : [ {{ msg.codeFilter | to_array | batch_render: 'DataType/DataRequirement/CodeFilter', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_DecimalToQuantity.liquid b/data/Templates/Stu3ToR4/DataType/_DecimalToQuantity.liquid new file mode 100644 index 000000000..1bd175ba7 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_DecimalToQuantity.liquid @@ -0,0 +1,5 @@ +{ + {% if msg -%} + "value" : {{msg}} + {% endif -%} +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_Dosage.liquid b/data/Templates/Stu3ToR4/DataType/_Dosage.liquid new file mode 100644 index 000000000..80680ea37 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_Dosage.liquid @@ -0,0 +1,18 @@ +{% mergeDiff msg -%} +{ + "doseAndRate" : [ + { + "doseRange":{{msg.doseRange | to_json_string | default : '""'}}, + "doseQuantity":{{msg.doseQuantity | to_json_string | default : '""'}}, + "rateRatio":{{msg.rateRatio | to_json_string | default : '""'}}, + "rateRange":{{msg.rateRange | to_json_string | default : '""'}}, + "rateQuantity":{{msg.rateQuantity | to_json_string | default : '""'}}, + } + ], + "doseRange" : "", + "doseQuantity" : "", + "rateRatio" : "", + "rateRange" : "", + "rateQuantity" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/DataType/_Extension.liquid b/data/Templates/Stu3ToR4/DataType/_Extension.liquid new file mode 100644 index 000000000..4632b3c55 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_Extension.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "valueMoney" : {% include 'DataType/Money' msg : msg.valueMoney -%}, + "valueSignature" : {% include 'DataType/Money' msg : msg.valueSignature -%}, + "valueDataRequirement" : {% include 'DataType/DataRequirement' msg : msg.valueDataRequirement -%}, + "valueDosage" : {% include 'DataType/Dosage' msg : msg.valueDosage -%}, + "valueRelatedArtifact" : {% include 'DataType/RelatedArtifact' msg : msg.valueRelatedArtifact -%}, + "valueTriggerDefinition" : {% include 'DataType/TriggerDefinition' msg : msg.valueTriggerDefinition -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_IdToOid.liquid b/data/Templates/Stu3ToR4/DataType/_IdToOid.liquid new file mode 100644 index 000000000..a062e2fba --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_IdToOid.liquid @@ -0,0 +1 @@ +"{{'urn:oid:' | appand : msg}}" \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_IdentifierToCodeableConcept.liquid b/data/Templates/Stu3ToR4/DataType/_IdentifierToCodeableConcept.liquid new file mode 100644 index 000000000..9cf35f46a --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_IdentifierToCodeableConcept.liquid @@ -0,0 +1,4 @@ +{ + "coding" : [{{msg.type | to_json_string | default : '""'}}], + "text" : "{{msg.value}}" +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_IdentifierToReference.liquid b/data/Templates/Stu3ToR4/DataType/_IdentifierToReference.liquid new file mode 100644 index 000000000..775b173d7 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_IdentifierToReference.liquid @@ -0,0 +1,3 @@ +{ + "identifier":{{msg | to_json_string | default : '""'}}, +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_Money.liquid b/data/Templates/Stu3ToR4/DataType/_Money.liquid new file mode 100644 index 000000000..cecd62d41 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_Money.liquid @@ -0,0 +1,4 @@ +{ + "value": "{{msg.value}}", + "currency" : "{{msg.code}}", +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_OidToId.liquid b/data/Templates/Stu3ToR4/DataType/_OidToId.liquid new file mode 100644 index 000000000..b3c1d5911 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_OidToId.liquid @@ -0,0 +1 @@ +"{{msg | remove : 'urn:oid:'}}" \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Shared/_ReferenceToCanonical.liquid b/data/Templates/Stu3ToR4/DataType/_ReferenceToCanonical.liquid similarity index 100% rename from data/Templates/Stu3ToR4/Shared/_ReferenceToCanonical.liquid rename to data/Templates/Stu3ToR4/DataType/_ReferenceToCanonical.liquid diff --git a/data/Templates/Stu3ToR4/DataType/_RelatedArtifact.liquid b/data/Templates/Stu3ToR4/DataType/_RelatedArtifact.liquid new file mode 100644 index 000000000..377f70b97 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_RelatedArtifact.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "resource" : {% include 'DataType/ReferenceToCanonical' msg: msg.resource -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_ResourceMapping.liquid b/data/Templates/Stu3ToR4/DataType/_ResourceMapping.liquid new file mode 100644 index 000000000..76cc6a816 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_ResourceMapping.liquid @@ -0,0 +1,24 @@ +{% case msg -%} + {% when "BodySite" %} + "BodyStructure" + {% when "DataElement" %} + "StructureDefinition" + {% when "EligibilityRequest" %} + "CoverageEligibilityRequest" + {% when "EligibilityResponse" %} + "CoverageEligibilityResponse" + {% when "ExpansionProfile" %} + "Parameters" + {% when "Sequence" %} + "MolecularSequence" + {% when "ProcessRequest" %} + "Task" + {% when "ProcessResponse" %} + "Task" + {% when "ReferralRequest" %} + "ServiceRequest" + {% when "ProcedureRequest" %} + "ServiceRequest" + {% else -%} + "{{msg}}" +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DataType/_Signature.liquid b/data/Templates/Stu3ToR4/DataType/_Signature.liquid new file mode 100644 index 000000000..15e29cb7a --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_Signature.liquid @@ -0,0 +1,33 @@ +{% mergeDiff msg -%} +{ + "onBehalfOf[x]" : "", + "who[x]" : "", + {%if msg.whoUri -%} + "who" : { + "reference" : "{{msg.whoUri}}", + "extension" : { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/BaseType", + "valueString" : "uri" + } + }, + {% else if msg.whoReference -%} + "who" : {{msg.whoReference | to_json_string | default : '""'}}, + {% endif -%} + {%if msg.onBehalfOfUri -%} + "onBehalfOf" : { + "reference" : "{{msg.onBehalfOfUri}}", + "extension" : { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/BaseType", + "valueString" : "uri" + } + }, + {% else if msg.onBehalfOfReference -%} + "onBehalfOf" : {{msg.onBehalfOfReference | to_json_string | default : '""'}}, + {% endif -%} + "sigFormat" : "{{msg.contentType}}", + "data" : "{{msg.blob}}", + "blob" : "", + "contentType" : "", +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/Shared/_StringToAnnotation.liquid b/data/Templates/Stu3ToR4/DataType/_StringToAnnotation.liquid similarity index 100% rename from data/Templates/Stu3ToR4/Shared/_StringToAnnotation.liquid rename to data/Templates/Stu3ToR4/DataType/_StringToAnnotation.liquid diff --git a/data/Templates/Stu3ToR4/DataType/_TriggerDefinition.liquid b/data/Templates/Stu3ToR4/DataType/_TriggerDefinition.liquid new file mode 100644 index 000000000..464834743 --- /dev/null +++ b/data/Templates/Stu3ToR4/DataType/_TriggerDefinition.liquid @@ -0,0 +1,15 @@ +{% mergeDiff msg -%} +{ + "name" : "{{msg.eventName}}", + "timingTiming" : {{msg.eventTimingTiming | to_json_string | default : '""'}}, + "timingReference" : {{msg.eventTimingReference | to_json_string | default : '""'}}, + "timingDate" : "{{msg.eventTimingDate}}", + "timingDateTime" : "{{msg.eventTimingDateTime}}", + "data" : [ + {% include 'DataType/DataRequirement' msg: msg.eventData -%} + ], + "eventData" : "", + "eventTiming[x]" : "", + "eventName" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DetectedIssue.liquid b/data/Templates/Stu3ToR4/DetectedIssue.liquid new file mode 100644 index 000000000..518a27a37 --- /dev/null +++ b/data/Templates/Stu3ToR4/DetectedIssue.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "code" : {{msg.category | to_json_string | default : '""'}}, + "identifiedDateTime" : "{{msg.date}}", + "date" : "", + "category" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Device.liquid b/data/Templates/Stu3ToR4/Device.liquid new file mode 100644 index 000000000..5b33cd7b2 --- /dev/null +++ b/data/Templates/Stu3ToR4/Device.liquid @@ -0,0 +1,31 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "udiCarrier" : [ + { + "deviceIdentifier" : "{{msg.udi.deviceIdentifier}}", + "deviceName" : [ + {%if msg.udi.name -%} + { + "name" : "{{msg.udi.name}}", + "type" : "udi-label-name" + }, + {% endif -%} + ], + "jurisdiction" : "{{msg.udi.jurisdiction}}", + "carrierHRF" : "{{msg.udi.carrierHRF}}", + "carrierAIDC" : "{{msg.udi.carrierAIDC}}", + "issuer" : "{{msg.udi.issuer}}", + "entryType" : "{{msg.udi.entryType}}" + } + ], + "modelNumber" : "{{msg.model}}", + "version" : [ + { + "value" : "{{msg.version}}" + } + ], + "model" : "", + "udi" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DeviceMetric.liquid b/data/Templates/Stu3ToR4/DeviceMetric.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/DeviceMetric.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DeviceRequest.liquid b/data/Templates/Stu3ToR4/DeviceRequest.liquid new file mode 100644 index 000000000..7c388950e --- /dev/null +++ b/data/Templates/Stu3ToR4/DeviceRequest.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "intent" : {{msg.intent.coding[0].code | to_json_string | default : '""'}}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "requester" : {{msg.requester.agent | to_json_string | default : '""'}}, + "context" : "", + "definition" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/DeviceUseStatement.liquid b/data/Templates/Stu3ToR4/DeviceUseStatement.liquid new file mode 100644 index 000000000..b8283309d --- /dev/null +++ b/data/Templates/Stu3ToR4/DeviceUseStatement.liquid @@ -0,0 +1,19 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.whenUsed -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-DeviceUseStatement.whenUsed", + "valuePeriod" : {{msg.whenUsed | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "reasonCode" : {{msg.indication | to_json_string | default : '""'}}, + "indication" : "", + "whenUsed" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DiagnosticReport.liquid b/data/Templates/Stu3ToR4/DiagnosticReport.liquid new file mode 100644 index 000000000..53eaca6ec --- /dev/null +++ b/data/Templates/Stu3ToR4/DiagnosticReport.liquid @@ -0,0 +1,12 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "performer" : [ {{ msg.performer | to_array | batch_render: 'DiagnosticReport/Performer', 'msg' }} ], + "media" : {{msg.image | to_json_string | default : '""' }}, + "conclusionCode" : {{msg.codedDiagnosis | to_json_string | default : '""'}}, + "codedDiagnosis" : "", + "image" : "", + "context" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DiagnosticReport/_Performer.liquid b/data/Templates/Stu3ToR4/DiagnosticReport/_Performer.liquid new file mode 100644 index 000000000..aefd24ec1 --- /dev/null +++ b/data/Templates/Stu3ToR4/DiagnosticReport/_Performer.liquid @@ -0,0 +1,17 @@ +{% mergeDiff msg -%} +{ + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.role -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-DiagnosticReport.performer.role", + "valueCodeableConcept" : {{msg.role | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "actor" : "", + "role" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/DocumentManifest.liquid b/data/Templates/Stu3ToR4/DocumentManifest.liquid new file mode 100644 index 000000000..3581255dc --- /dev/null +++ b/data/Templates/Stu3ToR4/DocumentManifest.liquid @@ -0,0 +1,12 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "content" : [ + {% for c in msg.content %} + {% if c.pReference %} + {{c.pReference | to_json_string | default : '""'}}, + {% endif %} + {% endfor %} + ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/DocumentReference.liquid b/data/Templates/Stu3ToR4/DocumentReference.liquid new file mode 100644 index 000000000..ef335a13f --- /dev/null +++ b/data/Templates/Stu3ToR4/DocumentReference.liquid @@ -0,0 +1,26 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "category" : [ + {{msg.class | to_json_string | default : '""'}} + ], + "author" : "", + "date" : "{{msg.indexed | date: "yyyy-MM-ddTHH:mm:ss.fff%K" }}", + "created" : "", + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.created -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-DocumentReference.created", + "valuedateTime" : "{{msg.created | date: "yyyy-MM-ddTHH:mm:ss.fff%K" }}" + }, + {% endif -%} + ], + "indexed" : "", + "class" : "", + "context" : {% include 'DocumentReference/Context' msg: msg.context -%} +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/DocumentReference/_Context.liquid b/data/Templates/Stu3ToR4/DocumentReference/_Context.liquid new file mode 100644 index 000000000..cb29c9d8c --- /dev/null +++ b/data/Templates/Stu3ToR4/DocumentReference/_Context.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "related" : [ + {% for r in msg.related %} + {% if r.ref %} + {{ r.ref | to_json_string | default : '""' }} + {% endif %} + {% endfor %} + ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/EligibilityRequest.liquid b/data/Templates/Stu3ToR4/EligibilityRequest.liquid new file mode 100644 index 000000000..ea7a10553 --- /dev/null +++ b/data/Templates/Stu3ToR4/EligibilityRequest.liquid @@ -0,0 +1,23 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "resourceType" : "CoverageEligibilityRequest", + "insurance" : [ + { + "focal" : true, + "coverage" : {{msg.coverage | to_json_string | default : '""' }}, + "businessArrangement" : "{{msg.businessArrangement}}" + } + ], + "item" : [ + { + "category" : {{msg.benefitCategory | to_json_string | default : '""' }} + } + ], + "benefitSubCategory" : "", + "benefitCategory" : "", + "businessArrangement" : "", + "coverage" : "", + "organization" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/EligibilityResponse.liquid b/data/Templates/Stu3ToR4/EligibilityResponse.liquid new file mode 100644 index 000000000..df2421e8c --- /dev/null +++ b/data/Templates/Stu3ToR4/EligibilityResponse.liquid @@ -0,0 +1,18 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "resourceType" : "CoverageEligibilityResponse", + "requestor" : {{msg.requestProvider | to_json_string | default : '""'}}, + "inforce" : "", + {% assign value = msg.outcome.coding[0].code -%} + {% if value == 'complete' or value == 'error' or value == 'partial' -%} + "outcome" : "{{value}}", + {% else %} + "outcome":"", + {% endif -%} + "requestOrganization" : "", + "insurance" : [ {{ msg.insurance | to_array | batch_render: 'EligibilityResponse/EligibilityResponseInsurance', 'insurance' }} ], + "requestProvider" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/EligibilityResponse/_EligibilityResponseInsurance.liquid b/data/Templates/Stu3ToR4/EligibilityResponse/_EligibilityResponseInsurance.liquid new file mode 100644 index 000000000..0f75faa26 --- /dev/null +++ b/data/Templates/Stu3ToR4/EligibilityResponse/_EligibilityResponseInsurance.liquid @@ -0,0 +1,9 @@ +{% mergeDiff insurance -%} +{ + {% if msg.inforce == true -%} + "inforce" : true, + {% endif -%} + "benefitBalance" : "", + "contract" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Encounter.liquid b/data/Templates/Stu3ToR4/Encounter.liquid new file mode 100644 index 000000000..40bdbe7f6 --- /dev/null +++ b/data/Templates/Stu3ToR4/Encounter.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "basedOn" : {{msg.incomingReferral | to_json_string | default : '""'}}, + "reasonCode" : {{msg.reason | to_json_string | default : '""'}}, + "diagnosis" : [ {{ msg.diagnosis | to_array | batch_render: 'Encounter/Diagnosis', 'msg' }} ], + "reason" : "", + "incomingReferral" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Encounter/_Diagnosis.liquid b/data/Templates/Stu3ToR4/Encounter/_Diagnosis.liquid new file mode 100644 index 000000000..14bf0e223 --- /dev/null +++ b/data/Templates/Stu3ToR4/Encounter/_Diagnosis.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "use" : {{msg.role | to_json_string | default : '""'}}, + "role" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Endpoint.liquid b/data/Templates/Stu3ToR4/Endpoint.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Endpoint.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/EnrollmentRequest.liquid b/data/Templates/Stu3ToR4/EnrollmentRequest.liquid new file mode 100644 index 000000000..94d79cf79 --- /dev/null +++ b/data/Templates/Stu3ToR4/EnrollmentRequest.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "candidate" : {{msg.subject | to_json_string | default : '""'}}, + "subject" : "", + "organization" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/EnrollmentResponse.liquid b/data/Templates/Stu3ToR4/EnrollmentResponse.liquid new file mode 100644 index 000000000..b42968f0c --- /dev/null +++ b/data/Templates/Stu3ToR4/EnrollmentResponse.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "outcome" : "", + {% assign value = msg.outcome.coding[0].code %} + {% if value == 'complete' or value == 'error' or value == 'partial' -%} + "outcome" : "{{value}}", + {% endif -%} + "requestOrganization" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/EpisodeOfCare.liquid b/data/Templates/Stu3ToR4/EpisodeOfCare.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/EpisodeOfCare.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit.liquid new file mode 100644 index 000000000..abfe9522b --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit.liquid @@ -0,0 +1,29 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "outcome" : "", + {% assign value = msg.outcome.coding[0].code %} + {% if value == 'complete' or value == 'error' or value == 'partial' -%} + "outcome" : "{{value}}", + {% endif -%} + "payee" : {% include 'ExplanationOfBenefit/ExplanationOfBenefitPayee' msg: msg.payee -%}, + "supportingInfo" : {{msg.information | to_json_string | default : '""' }}, + "item" : [ {{ msg.item | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitItem', 'msg' }} ], + "addItem" : [ {{ msg.addItem | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitAddItem', 'msg' }} ], + "total" : [ + {% include 'ExplanationOfBenefit/ExplanationOfBenefitTotalCost' msg: msg.totalCost -%}, + {% include 'ExplanationOfBenefit/ExplanationOfBenefitTotalBenefit' msg: msg.totalBenefit -%} + ], + "payment" : {% include 'ExplanationOfBenefit/ExplanationOfBenefitPayment' msg: msg.payment -%}, + "form" : {% include 'DataType/CodeableConceptToAttachment' msg: msg.form -%}, + "processNote" : [ {{ msg.processNote | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitProcessNote', 'msg' }} ], + "benefitBalance" : [ {{ msg.benefitBalance | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitBenefitBalance', 'msg' }} ], + "totalBenefit" : "", + "unallocDeductable" : "", + "totalCost" : "", + "hospitalization" : "", + "employmentImpacted" : "", + "information" : "", + "organization" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItem.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItem.liquid new file mode 100644 index 000000000..a14d57bfb --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItem.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ExplanationOfBenefitItemAdjudication', 'msg' }} ], + "detail" : [ {{ msg.detail | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitAddItemDetail', 'msg' }} ], + "fee" : "", + "service" : "", + "category" : "", + "revenue" : "", + "sequenceLinkId" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItemDetail.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItemDetail.liquid new file mode 100644 index 000000000..042bdcbd5 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItemDetail.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ExplanationOfBenefitItemAdjudication', 'msg' }} ], + "fee" : "", + "service" : "", + "category" : "", + "revenue" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItemDetailSubDetail.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItemDetailSubDetail.liquid new file mode 100644 index 000000000..34cd97ad9 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitAddItemDetailSubDetail.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "unitPrice" : {% include 'DataType/Money' msg: msg.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: msg.net -%}, + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ExplanationOfBenefitItemAdjudication', 'msg' }} ], + "service" : "", + "type" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitBenefitBalance.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitBenefitBalance.liquid new file mode 100644 index 000000000..e2415b218 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitBenefitBalance.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "subCategory" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItem.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItem.liquid new file mode 100644 index 000000000..703271ade --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItem.liquid @@ -0,0 +1,18 @@ +{% mergeDiff msg -%} +{ + "careTeamSequence" : {{msg.careTeamLinkId | to_json_string | default : '""'}}, + "diagnosisSequence" : {{msg.diagnosisLinkId | to_json_string | default : '""'}}, + "procedureSequence" : {{msg.procedureLinkId | to_json_string | default : '""'}}, + "informationSequence" : {{msg.informationLinkId | to_json_string | default : '""'}}, + "productOrService" : {{msg.service | to_json_string | default : '""'}}, + "unitPrice" : {% include 'DataType/Money' msg: msg.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: msg.net -%}, + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitItemAdjudication', 'msg' }} ], + "detail" : [ {{ msg.detail | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitItemDetail', 'msg' }} ], + "service" : "", + "informationLinkId" : "", + "procedureLinkId" : "", + "diagnosisLinkId" : "", + "careTeamLinkId" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemAdjudication.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemAdjudication.liquid new file mode 100644 index 000000000..58ce319e9 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemAdjudication.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "amount" : {% include 'DataType/Money' msg: msg.amount -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemDetail.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemDetail.liquid new file mode 100644 index 000000000..6c4f20bd1 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemDetail.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "unitPrice" : {% include 'DataType/Money' msg: msg.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: msg.net -%}, + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ExplanationOfBenefitItemAdjudication', 'msg' }} ], + "subDetail" : [ {{ msg.subDetail | to_array | batch_render: 'ExplanationOfBenefit/ExplanationOfBenefitItemDetailSubDetail', 'msg' }} ], + "service" : "", + "type" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemDetailSubDetail.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemDetailSubDetail.liquid new file mode 100644 index 000000000..34cd97ad9 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitItemDetailSubDetail.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "unitPrice" : {% include 'DataType/Money' msg: msg.unitPrice -%}, + "net" : {% include 'DataType/Money' msg: msg.net -%}, + "adjudication" : [ {{ msg.adjudication | to_array | batch_render: '_ExplanationOfBenefitItemAdjudication', 'msg' }} ], + "service" : "", + "type" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitPayee.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitPayee.liquid new file mode 100644 index 000000000..66fb17285 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitPayee.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "resourceType" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitPayment.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitPayment.liquid new file mode 100644 index 000000000..e89086eb0 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitPayment.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "adjustment" : {% include 'DataType/Money' msg: msg.adjustment -%}, + "amount" : {% include 'DataType/Money' msg: msg.amount -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitProcessNote.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitProcessNote.liquid new file mode 100644 index 000000000..5c111b5ed --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitProcessNote.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "type" : {% include 'DataType/CodeableConceptToCode' msg: msg.type -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitTotalBenefit.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitTotalBenefit.liquid new file mode 100644 index 000000000..34e4670c3 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitTotalBenefit.liquid @@ -0,0 +1,10 @@ +{ + "category" : { + "text" : "Benefit Amount", + "coding" : { + "code" : "benefit", + "system" : "http://terminology.hl7.org/CodeSystem/adjudication" + } + }, + "amount" : {% include 'DataType/Money' msg: msg -%} +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitTotalCost.liquid b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitTotalCost.liquid new file mode 100644 index 000000000..69d6811d3 --- /dev/null +++ b/data/Templates/Stu3ToR4/ExplanationOfBenefit/_ExplanationOfBenefitTotalCost.liquid @@ -0,0 +1,10 @@ +{ + "category" : { + "text" : "Submitted Amount", + "coding" : { + "code" : "submitted", + "system" : "http://terminology.hl7.org/CodeSystem/adjudication" + } + }, + "amount" : {% include 'DataType/Money' msg: msg -%} +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/FamilyMemberHistory.liquid b/data/Templates/Stu3ToR4/FamilyMemberHistory.liquid new file mode 100644 index 000000000..d034594c1 --- /dev/null +++ b/data/Templates/Stu3ToR4/FamilyMemberHistory.liquid @@ -0,0 +1,31 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "instantiatesCanonical" : [ {{ msg.definition | to_array | batch_render: 'DataType/ReferenceToCanonical', 'msg' }} ], + {%if msg.notDone -%} + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-FamilyMemberHistory.notDone", + "valueBoolean" : "{{msg.notDone}}" + }, + ], + {% endif -%} + "dataAbsentReason" : {{msg.notDoneReason | to_json_string | default : '""'}}, + {%if msg.gender -%} + "sex" : { + "coding" : [ + { + "system" : "http://hl7.org/fhir/administrative-gender", + "code" : "{{msg.gender}}" + } + ] + }, + {% endif -%} + "definition" : "", + "gender" : "", + "notDone" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/Flag.liquid b/data/Templates/Stu3ToR4/Flag.liquid new file mode 100644 index 000000000..10e3f5606 --- /dev/null +++ b/data/Templates/Stu3ToR4/Flag.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "category" : [ + {{msg.category | to_json_string | default : '""' }}, + ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Goal.liquid b/data/Templates/Stu3ToR4/Goal.liquid new file mode 100644 index 000000000..8341df2d4 --- /dev/null +++ b/data/Templates/Stu3ToR4/Goal.liquid @@ -0,0 +1,52 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + {% assign value = msg.status %} + {% if value == 'proposed' or value == 'planned' or value == 'accepted' or value == 'on-hold' or value == 'cancelled' or value == 'entered-in-error' or value == 'rejected' -%} + "lifecycleStatus" : "{{value}}", + {% elseif value == 'achieved' -%} + "lifecycleStatus" : "completed", + {% elseif value == 'in-progress' or value == 'sustaining' -%} + "lifecycleStatus" : "active", + "achievementStatus" : { + "coding" : [ + { + "system" : "http://terminology.hl7.org/CodeSystem/goal-achievement", + "code" : "{{value}}" + } + ] + }, + {% elseif value == 'on-target' -%} + "lifecycleStatus" : "active", + "achievementStatus" : { + "coding" : [ + { + "system" : "http://terminology.hl7.org/CodeSystem/goal-achievement", + "code" : "sustaining" + } + ] + }, + {% elseif value == 'ahead-of-target' -%} + "lifecycleStatus" : "active", + "achievementStatus" : { + "coding" : [ + { + "system" : "http://terminology.hl7.org/CodeSystem/goal-achievement", + "code" : "improving" + } + ] + }, + {% elseif value == 'behind-target' -%} + "lifecycleStatus" : "active", + "achievementStatus" : { + "coding" : [ + { + "system" : "http://terminology.hl7.org/CodeSystem/goal-achievement", + "code" : "worsening" + } + ] + }, + {% endif -%} + "status" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/GraphDefinition.liquid b/data/Templates/Stu3ToR4/GraphDefinition.liquid new file mode 100644 index 000000000..db53f5236 --- /dev/null +++ b/data/Templates/Stu3ToR4/GraphDefinition.liquid @@ -0,0 +1,7 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "link" : [ {{ msg.link | to_array | batch_render: 'GraphDefinition/Link', 'msg' }} ] +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/GraphDefinition/_Compartment.liquid b/data/Templates/Stu3ToR4/GraphDefinition/_Compartment.liquid new file mode 100644 index 000000000..ee7c6ac0b --- /dev/null +++ b/data/Templates/Stu3ToR4/GraphDefinition/_Compartment.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "use" : "requirement" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/GraphDefinition/_Link.liquid b/data/Templates/Stu3ToR4/GraphDefinition/_Link.liquid new file mode 100644 index 000000000..02b2de131 --- /dev/null +++ b/data/Templates/Stu3ToR4/GraphDefinition/_Link.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "target" : [ {{ msg.target | to_array | batch_render: 'GraphDefinition/TheTarget', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/GraphDefinition/_TheTarget.liquid b/data/Templates/Stu3ToR4/GraphDefinition/_TheTarget.liquid new file mode 100644 index 000000000..114b5b99d --- /dev/null +++ b/data/Templates/Stu3ToR4/GraphDefinition/_TheTarget.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "compartment" : [ {{ msg.compartment | to_array | batch_render: 'GraphDefinition/Compartment', 'msg' }} ], + "link" : [ {{ msg.link | to_array | batch_render: 'GraphDefinition/Link', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Group.liquid b/data/Templates/Stu3ToR4/Group.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Group.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/GuidanceResponse.liquid b/data/Templates/Stu3ToR4/GuidanceResponse.liquid new file mode 100644 index 000000000..8f3681011 --- /dev/null +++ b/data/Templates/Stu3ToR4/GuidanceResponse.liquid @@ -0,0 +1,19 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [{{msg.identifier | to_json_string | default : '""'}}], + "requestIdentifier" : { + "value" : "{{msg.requestId}}" + }, + "moduleCanonical" : {% include 'DataType/ReferenceToCanonical' msg: msg.module -%}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "reasonCode" : [{{msg.reasonCodeableConcept | to_json_string | default : '""'}}], + "reasonReference" : [{{msg.reasonReference | to_json_string | default : '""'}}], + "dataRequirement" : [ {{ msg.dataRequirement | to_array | batch_render: 'DataType/DataRequirement', 'msg' }} ], + "context" : "", + "requestId" : "", + "module" : "", + "reasonCodeableConcept": "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/HealthcareService.liquid b/data/Templates/Stu3ToR4/HealthcareService.liquid new file mode 100644 index 000000000..8eec1554a --- /dev/null +++ b/data/Templates/Stu3ToR4/HealthcareService.liquid @@ -0,0 +1,19 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "category" : [{{ msg.category | to_json_string | default : '""' }}], + "eligibility" :[ + { + "code" : {{msg.eligibility | to_json_string | default : '""' }}, + "comment" : "{{msg.eligibilityNote}}" + } + ], + "program" : [ + { + "text": "{{msg.programName}}" + } + ], + "eligibilityNote" : "", + "programName" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImagingStudy.liquid b/data/Templates/Stu3ToR4/ImagingStudy.liquid new file mode 100644 index 000000000..ba7ea237f --- /dev/null +++ b/data/Templates/Stu3ToR4/ImagingStudy.liquid @@ -0,0 +1,39 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [ + {%if msg.uid -%} + { + "system" : "urn:dicom:uid", + "value" : "{{msg.uid}}" + }, + {% endif -%} + {% for i in msg.identifier -%} + {{ i | to_json_string | default : '""'}}, + {% endfor -%} + {{msg.accession | to_json_string | default : '""'}} + ], + {% if msg.availability == 'OFFLINE' or msg.availability == 'UNAVAILABLE' -%} + "status" : "registered", + {% elseif msg.availability == 'ONLINE' or msg.availability == 'NEARLINE' -%} + "status" : "available", + {% elseif msg.availability == null -%} + "status" : "unknown", + {% endif -%} + "modality" : {{msg.modalityList | to_json_string | default : '""'}}, + "subject" : {{msg.patient | to_json_string | default : '""'}}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "procedureReference": {{msg.procedureReference[0] | to_json_string | default : '""'}}, + "reasonCode" : [ + {{msg.reason | to_json_string | default : '""'}} + ], + "series" : [ {{ msg.series | to_array | batch_render: 'ImagingStudy/Series', 'msg' }} ], + "reason" : "", + "context" : "", + "patient" : "", + "modalityList" : "", + "availability" : "", + "accession" : "", + "uid" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImagingStudy/_Instance.liquid b/data/Templates/Stu3ToR4/ImagingStudy/_Instance.liquid new file mode 100644 index 000000000..effd707e7 --- /dev/null +++ b/data/Templates/Stu3ToR4/ImagingStudy/_Instance.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "uid" : {% include 'DataType/OidToId' msg: msg.uid -%}, + {%if msg.sopClass -%} + "sopClass" : { + "system" : "urn:ietf:rfc:3986", + "code" : "{{msg.sopClass}}" + }, + {% endif -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImagingStudy/_Performer.liquid b/data/Templates/Stu3ToR4/ImagingStudy/_Performer.liquid new file mode 100644 index 000000000..3feceb75b --- /dev/null +++ b/data/Templates/Stu3ToR4/ImagingStudy/_Performer.liquid @@ -0,0 +1,11 @@ +{ + "function" : { + "coding" : [ + { + "system" : "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", + "code" : "PRF" + } + ] + }, + "actor" : {{msg | to_json_string | default : '""'}}, +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImagingStudy/_Series.liquid b/data/Templates/Stu3ToR4/ImagingStudy/_Series.liquid new file mode 100644 index 000000000..4bd9d5d71 --- /dev/null +++ b/data/Templates/Stu3ToR4/ImagingStudy/_Series.liquid @@ -0,0 +1,19 @@ +{% mergeDiff msg -%} +{ + "uid" : {% include 'DataType/OidToId' msg: msg.uid -%}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.availability -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ImagingStudy.series.availability", + "valueCode" : "{{msg.availability}}" + }, + {% endif -%} + ], + "performer" : [ {{ msg.performer | to_array | batch_render: 'ImagingStudy/Performer', 'msg' }} ], + "instance" : [ {{ msg.instance | to_array | batch_render: 'ImagingStudy/Instance', 'msg' }} ], + "availability" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Immunization.liquid b/data/Templates/Stu3ToR4/Immunization.liquid new file mode 100644 index 000000000..3f597d905 --- /dev/null +++ b/data/Templates/Stu3ToR4/Immunization.liquid @@ -0,0 +1,30 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + {% if msg.notGiven == true -%} + "status" : "not-done", + {% endif -%} + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.notGiven -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Immunization.notGiven", + "valueBoolean" : "{{msg.notGiven}}" + }, + {% endif -%} + ], + "occurrenceDateTime" : "{{msg.date}}", + "performer" : [ {{ msg.practitioner | to_array | batch_render: 'Immunization/Practitioner', 'msg' }} ], + "reasonCode" : {{msg.explanation.reason | to_json_string | default : '""'}}, + "reasonCode" : {{msg.explanation.reasonNotGiven | to_json_string | default : '""'}}, + "protocolApplied" : [ {{ msg.vaccinationProtocol | to_array | batch_render: 'Immunization/Protocol', 'msg' }} ], + "vaccinationProtocol" : "", + "explanation" : "", + "practitioner" : "", + "date" : "", + "notGiven" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/Immunization/_Practitioner.liquid b/data/Templates/Stu3ToR4/Immunization/_Practitioner.liquid new file mode 100644 index 000000000..aa9e1b726 --- /dev/null +++ b/data/Templates/Stu3ToR4/Immunization/_Practitioner.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "function" : {{msg.role | to_json_string | default : '""'}}, + "role" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Immunization/_Protocol.liquid b/data/Templates/Stu3ToR4/Immunization/_Protocol.liquid new file mode 100644 index 000000000..756276229 --- /dev/null +++ b/data/Templates/Stu3ToR4/Immunization/_Protocol.liquid @@ -0,0 +1,34 @@ +{% mergeDiff msg -%} +{ + "doseNumberPositiveInt" : {{msg.doseSequence}}, + "doseNumberPositiveInt" : {{msg.seriesDoses}}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.description -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Immunization.vaccinationProtocol.description", + "valueString" : "{{msg.description}}" + }, + {% endif -%} + {%if msg.doseStatus -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Immunization.vaccinationProtocol.doseStatus", + "valueCodeableConcept" : {{msg.doseStatus | to_json_string | default : '""' }} + }, + {% endif -%} + {%if msg.doseStatusReason -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Immunization.vaccinationProtocol.doseStatusReason", + "valueCodeableConcept" : {{msg.doseStatusReason | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "description" : "", + "doseStatus" : "", + "doseStatusReason" : "", + "doseSequence" : "", + "seriesDoses" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImmunizationRecommendation.liquid b/data/Templates/Stu3ToR4/ImmunizationRecommendation.liquid new file mode 100644 index 000000000..6dc360824 --- /dev/null +++ b/data/Templates/Stu3ToR4/ImmunizationRecommendation.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "recommendation" : [{{msg.recommendation | to_array | batch_render : 'ImmunizationRecommendation/Recommendation', 'msg' }}], + "date" : "{{msg.recommendation[0].date | date: "yyyy-MM-ddTHH:mm:ss.fff%K" }}", + "authority" : {{msg.recommendation[0].protocol.authority | to_json_string | default : '""'}}, +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/ImmunizationRecommendation/_Recommendation.liquid b/data/Templates/Stu3ToR4/ImmunizationRecommendation/_Recommendation.liquid new file mode 100644 index 000000000..fc88fc82a --- /dev/null +++ b/data/Templates/Stu3ToR4/ImmunizationRecommendation/_Recommendation.liquid @@ -0,0 +1,12 @@ +{% mergeDiff msg -%} +{ + "vaccineCode" : [{{msg.vaccineCode | to_json_string | default : '""'}}], + "doseNumberPositiveInt" : {{msg.doseNumber}}, + "doseNumber" : "", + "description" : "{{msg.protocol.description}}", + "series" : "{{msg.protocol.series}}", + "protocol" : "", + "seriesDosesPositiveInt" : {{msg.protocol.doseSequence}}, + "date" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImplementationGuide.liquid b/data/Templates/Stu3ToR4/ImplementationGuide.liquid new file mode 100644 index 000000000..e53858c00 --- /dev/null +++ b/data/Templates/Stu3ToR4/ImplementationGuide.liquid @@ -0,0 +1,24 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "dependsOn" :[ + {% for d in msg.dependency -%} + {% if d.type == 'reference' -%} + { + "uri":"{{d.uri}}" + }, + {% endif -%} + {% endfor %} + ], + "global" : [ {{ msg.global | to_array | batch_render: 'ImplementationGuide/Global', 'msg' }} ], + "definition" : {% include 'ImplementationGuide/Definition' msg: msg -%}, + {% if msg.binary -%} + "manifest" : {% include 'ImplementationGuide/Manifest' msg: msg -%}, + {% endif -%} + "page" : "", + "binary" : "", + "package" : "", + "dependency" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/ImplementationGuide/_Definition.liquid b/data/Templates/Stu3ToR4/ImplementationGuide/_Definition.liquid new file mode 100644 index 000000000..aaf014002 --- /dev/null +++ b/data/Templates/Stu3ToR4/ImplementationGuide/_Definition.liquid @@ -0,0 +1,9 @@ +{ + "grouping" : [ {{ msg.package | to_array | batch_render: 'ImplementationGuide/Grouping', 'msg' }} ], + "page" : {% include 'ImplementationGuide/Page' msg: msg.page -%}, + "resource": [ + {% for p in msg.package -%} + {{ p.resource | to_array | batch_render : 'ImplementationGuide/Resource', 'msg'}} + {% endfor -%} + ] +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImplementationGuide/_Global.liquid b/data/Templates/Stu3ToR4/ImplementationGuide/_Global.liquid new file mode 100644 index 000000000..9caf4f24b --- /dev/null +++ b/data/Templates/Stu3ToR4/ImplementationGuide/_Global.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "profile" : {% include 'DataType/ReferenceToCanonical' msg: msg.profile -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImplementationGuide/_Grouping.liquid b/data/Templates/Stu3ToR4/ImplementationGuide/_Grouping.liquid new file mode 100644 index 000000000..37ad173b5 --- /dev/null +++ b/data/Templates/Stu3ToR4/ImplementationGuide/_Grouping.liquid @@ -0,0 +1,4 @@ +{ + "name" : "{{msg.name}}", + "description" : "{{msg.description}}", +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImplementationGuide/_Manifest.liquid b/data/Templates/Stu3ToR4/ImplementationGuide/_Manifest.liquid new file mode 100644 index 000000000..7e9abb248 --- /dev/null +++ b/data/Templates/Stu3ToR4/ImplementationGuide/_Manifest.liquid @@ -0,0 +1,3 @@ +{ + "other" : {{msg.binary | to_json_string | default : '""'}}, +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ImplementationGuide/_Page.liquid b/data/Templates/Stu3ToR4/ImplementationGuide/_Page.liquid new file mode 100644 index 000000000..784debdcb --- /dev/null +++ b/data/Templates/Stu3ToR4/ImplementationGuide/_Page.liquid @@ -0,0 +1,40 @@ +{% mergeDiff msg -%} +{ + "nameUrl" : "{{msg.source}}", + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.kind -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ImplementationGuide.page.kind", + "valueCode" : "{{msg.kind}}" + }, + {% endif -%} + {% for t in mag.type -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ImplementationGuide.page.type", + "valueCode" : "{{t}}" + }, + {% endfor -%} + {% for p in mag.package -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ImplementationGuide.page.package", + "valueString" : "{{p}}" + }, + {% endfor -%} + {%if msg.format -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ImplementationGuide.page.format", + "valueCode" : "{{msg.format}}" + }, + {% endif -%} + ], + "page" : [ {{ msg.page | to_array | batch_render: 'ImplementationGuide/Page', 'msg' }} ], + "kind" : "", + "type" : "", + "package" : "", + "format" : "", + "source" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/ImplementationGuide/_Resource.liquid b/data/Templates/Stu3ToR4/ImplementationGuide/_Resource.liquid new file mode 100644 index 000000000..20ef17acc --- /dev/null +++ b/data/Templates/Stu3ToR4/ImplementationGuide/_Resource.liquid @@ -0,0 +1,37 @@ +{% mergeDiff msg -%} +{ + {% if msg.exampleFor == null -%} + "exampleBoolean" : {{msg.example}}, + {% else -%} + "exampleCanonical" : {% include 'DataType/ReferenceToCanonical' msg: msg.exampleFor -%}, + {% endif -%} + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.acronym -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ImplementationGuide.package.resource.acronym", + "valueString" : "{{msg.acronym}}" + }, + {% endif -%} + ], + {%if msg.sourceUri -%} + "reference" : { + "reference" : "{{msg.sourceUri}}", + "extension" : { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/BaseType", + "valueUri" : "uri" + } + }, + {% endif -%} + {%if msg.sourceReference -%} + "reference" : {{msg.sourceReference | to_json_string | default : '""'}}, + {% endif -%} + "exampleFor" : "", + "example" : "", + "acronym" : "", + "sourceUri" : "", + "sourceReference" :"" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Library.liquid b/data/Templates/Stu3ToR4/Library.liquid new file mode 100644 index 000000000..02f598e97 --- /dev/null +++ b/data/Templates/Stu3ToR4/Library.liquid @@ -0,0 +1,36 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "author" :[ + {% for c in msg.contributor %} + {% if c.type == 'author' -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "editor" :[ + {% for c in msg.contributor %} + {% if c.type == "editor" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "reviewer" :[ + {% for c in msg.contributor %} + {% if c.type == "reviewer" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "endorser" :[ + {% for c in msg.contributor %} + {% if c.type == "endorser" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "relatedArtifact" : [ {{ msg.relatedArtifact | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ], + "dataRequirement" : [ {{ msg.dataRequirement | to_array | batch_render: 'DataType/DataRequirement', 'msg' }} ], + "contributor" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Linkage.liquid b/data/Templates/Stu3ToR4/Linkage.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Linkage.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/List.liquid b/data/Templates/Stu3ToR4/List.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/List.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Location.liquid b/data/Templates/Stu3ToR4/Location.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Location.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Measure.liquid b/data/Templates/Stu3ToR4/Measure.liquid new file mode 100644 index 000000000..3ecf41998 --- /dev/null +++ b/data/Templates/Stu3ToR4/Measure.liquid @@ -0,0 +1,53 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "author" :[ + {% for c in msg.contributor %} + {% if c.type == 'author' -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "editor" :[ + {% for c in msg.contributor %} + {% if c.type == "editor" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "reviewer" :[ + {% for c in msg.contributor %} + {% if c.type == "reviewer" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "endorser" :[ + {% for c in msg.contributor %} + {% if c.type == "endorser" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "relatedArtifact" : [ {{ msg.relatedArtifact | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ], + "library" : [ {{ msg.library | to_array | batch_render: 'DataType/ReferenceToCanonical', 'msg' }} ], + "improvementNotation" : { + "text" : "{{msg.improvementNotation}}" + }, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.set -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Measure.set", + "valueString" : "{{msg.set}}" + }, + {% endif -%} + ], + "group" : [ {{ msg.group | to_array | batch_render: 'Measure/TheGroup', 'msg' }} ], + "supplementalData" : [ {{ msg.supplementalData | to_array | batch_render: 'Measure/SupplementalData', 'msg' }} ], + "contributor" : "", + "set" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Measure/_Population.liquid b/data/Templates/Stu3ToR4/Measure/_Population.liquid new file mode 100644 index 000000000..45f764011 --- /dev/null +++ b/data/Templates/Stu3ToR4/Measure/_Population.liquid @@ -0,0 +1,26 @@ +{% mergeDiff msg -%} +{ + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.identifier -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Measure.group.population.identifier", + "valueIdentifier" : {{msg.identifier | to_json_string | default : '""' }} + }, + {% endif -%} + {%if msg.name -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Measure.group.population.name", + "valueString" : "{{msg.name}}" + }, + {% endif -%} + ], + "criteria" : { + "expression" : "{{msg.criteria}}" + }, + "name" : "", + "identifier" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Measure/_Stratifier.liquid b/data/Templates/Stu3ToR4/Measure/_Stratifier.liquid new file mode 100644 index 000000000..fb0e5ab1a --- /dev/null +++ b/data/Templates/Stu3ToR4/Measure/_Stratifier.liquid @@ -0,0 +1,21 @@ +{% mergeDiff msg -%} +{ + "code" : {% include 'DataType/IdentifierToCodeableConcept' msg: msg.identifier -%}, + "criteria" : { + "expression" : "{{msg.criteria}}" + }, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.path -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Measure.group.stratifier.path", + "valueString" : "{{msg.path}}" + }, + {% endif -%} + ], + "identifier" : "", + "path" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Measure/_SupplementalData.liquid b/data/Templates/Stu3ToR4/Measure/_SupplementalData.liquid new file mode 100644 index 000000000..c92a1f4b6 --- /dev/null +++ b/data/Templates/Stu3ToR4/Measure/_SupplementalData.liquid @@ -0,0 +1,21 @@ +{% mergeDiff msg -%} +{ + "code" : {% include 'DataType/IdentifierToCodeableConcept' msg: msg.identifier -%}, + "criteria" : { + "expression" : "{{msg.criteria}}" + }, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.path -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Measure.supplementalData.path", + "valueString" : "{{msg.path}}" + }, + {% endif -%} + ], + "identifier" : "", + "path" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Measure/_TheGroup.liquid b/data/Templates/Stu3ToR4/Measure/_TheGroup.liquid new file mode 100644 index 000000000..20e6771ce --- /dev/null +++ b/data/Templates/Stu3ToR4/Measure/_TheGroup.liquid @@ -0,0 +1,20 @@ +{% mergeDiff msg -%} +{ + "code" : {% include 'DataType/IdentifierToCodeableConcept' msg: msg.identifier -%}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.name -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Measure.group.name", + "valueString" : "{{msg.name}}" + }, + {% endif -%} + ], + "population" : [ {{ msg.population | to_array | batch_render: 'Measure/Population', 'msg' }} ], + "stratifier" : [ {{ msg.stratifier | to_array | batch_render: 'Measure/Stratifier', 'msg' }} ], + "identifier" : "", + "name" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MeasureReport.liquid b/data/Templates/Stu3ToR4/MeasureReport.liquid new file mode 100644 index 000000000..6a6f3e0ac --- /dev/null +++ b/data/Templates/Stu3ToR4/MeasureReport.liquid @@ -0,0 +1,17 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "type" : {% include 'MeasureReport/TranslateTypeCode' msg : msg.type -%}, + "identifier" : [{{msg.identifier | to_json_string | default : '""' }}], + "measure" : {% include 'DataType/ReferenceToCanonical' msg: msg.measure -%}, + "subject" : {{msg.patient | to_json_string | default : '""'}}, + "reporter" : {{msg.reportingOrganization | to_json_string | default : '""'}}, + "group" : [ {{ msg.group | to_array | batch_render: 'MeasureReport/TheGroup', 'msg' }} ], + "evaluatedResource" : [ + {{msg.evaluatedResources | to_json_string | default : '""'}} + ], + "evaluatedResources" : "", + "reportingOrganization" : "", + "patient" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MeasureReport/_Population.liquid b/data/Templates/Stu3ToR4/MeasureReport/_Population.liquid new file mode 100644 index 000000000..dba229549 --- /dev/null +++ b/data/Templates/Stu3ToR4/MeasureReport/_Population.liquid @@ -0,0 +1,18 @@ +{% mergeDiff msg -%} +{ + {%if msg.identifier -%} + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MeasureReport.group.identifier", + "valueIdentifier" : {{msg.identifier | to_json_string | default : '""' }} + }, + ], + {% endif -%} + "subjectResults" : {{msg.patients | to_json_string | default : '""'}}, + "patients" : "", + "identifier" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MeasureReport/_Population2.liquid b/data/Templates/Stu3ToR4/MeasureReport/_Population2.liquid new file mode 100644 index 000000000..321be34cc --- /dev/null +++ b/data/Templates/Stu3ToR4/MeasureReport/_Population2.liquid @@ -0,0 +1,18 @@ +{% mergeDiff msg -%} +{ + {%if msg.identifier -%} + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MeasureReport.group.stratifier.stratum.population.identifier", + "valueIdentifier" : {{msg.identifier | to_json_string | default : '""' }} + }, + ], + {% endif -%} + "subjectResults" : {{msg.patients | to_json_string | default : '""'}}, + "patients" : "", + "identifier" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MeasureReport/_Stratifier.liquid b/data/Templates/Stu3ToR4/MeasureReport/_Stratifier.liquid new file mode 100644 index 000000000..d792535ee --- /dev/null +++ b/data/Templates/Stu3ToR4/MeasureReport/_Stratifier.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "code" : [ + {% include 'DataType/IdentifierToCodeableConcept' msg: msg.identifier -%} + ], + "stratum" : [ {{ msg.stratum | to_array | batch_render: 'MeasureReport/Stratum', 'msg' }} ], + "identifier" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MeasureReport/_Stratum.liquid b/data/Templates/Stu3ToR4/MeasureReport/_Stratum.liquid new file mode 100644 index 000000000..f96166ac5 --- /dev/null +++ b/data/Templates/Stu3ToR4/MeasureReport/_Stratum.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "value" : { + "text" : "{{msg.value}}" + }, + "population" : [ {{ msg.population | to_array | batch_render: 'MeasureReport/Population2', 'msg' }} ], + "measureScore" : {% include 'DataType/DecimalToQuantity' msg: msg.measureScore -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MeasureReport/_TheGroup.liquid b/data/Templates/Stu3ToR4/MeasureReport/_TheGroup.liquid new file mode 100644 index 000000000..4b459142b --- /dev/null +++ b/data/Templates/Stu3ToR4/MeasureReport/_TheGroup.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + "code" : {% include 'DataType/IdentifierToCodeableConcept' msg: msg.identifier -%}, + "population" : [ {{ msg.population | to_array | batch_render: 'MeasureReport/Population', 'msg' }} ], + "measureScore" : {% include 'DataType/DecimalToQuantity' msg: msg.measureScore -%}, + "stratifier" : [ {{ msg.stratifier | to_array | batch_render: 'MeasureReport/Stratifier', 'msg' }} ], + "identifier" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MeasureReport/_TranslateTypeCode.liquid b/data/Templates/Stu3ToR4/MeasureReport/_TranslateTypeCode.liquid new file mode 100644 index 000000000..dc864587f --- /dev/null +++ b/data/Templates/Stu3ToR4/MeasureReport/_TranslateTypeCode.liquid @@ -0,0 +1,8 @@ +{% case msg -%} + {% when "patient-list" -%} + "subject-list" + {% when "individual" -%} + "individual" + {% when "summary" -%} + "summary" +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Media.liquid b/data/Templates/Stu3ToR4/Media.liquid new file mode 100644 index 000000000..1fe8a20ea --- /dev/null +++ b/data/Templates/Stu3ToR4/Media.liquid @@ -0,0 +1,20 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + {%if msg.type -%} + "type" : { + "coding" : { + "system" : "http://terminology.hl7.org/CodeSystem/media-type", + "code" : "{{msg.type}}" + } + }, + {% endif -%} + "modality" : {{msg.subtype | to_json_string | default : '""'}}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "createdDateTime" : "{{msg.occurrenceDateTime}}", + "createdPeriod" : {{msg.occurrencePeriod | to_json_string | default : '""'}}, + "occurrence[x]" : "", + "context" : "", + "subtype" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Medication.liquid b/data/Templates/Stu3ToR4/Medication.liquid new file mode 100644 index 000000000..99d54b9f2 --- /dev/null +++ b/data/Templates/Stu3ToR4/Medication.liquid @@ -0,0 +1,61 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.status -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Medication.status", + "valueCode" : "{{msg.status}}" + }, + {% endif -%} + {%if msg.isBrand -%} + { + "url" : "hhttp://hl7.org/fhir/r3/StructureDefinition/extension-Medication.isBrand", + "valueBoolean" : "{{msg.isBrand}}" + }, + {% endif -%} + {%if msg.isOverTheCounter -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationOTC", + "valueBoolean" : "{{msg.isOverTheCounter}}" + }, + {% endif -%} + {%if msg.package.container -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-Medication.package.container", + "valueCodeableConcept" : {{msg.package.container | to_json_string | default : '""' }} + }, + {% endif -%} + {% for c in msg.package.content -%} + {% if c.itemCodableConcept -%} + { + "url" : "http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content", + "valueCodableConcept": {{c.itemCodableConcept |to_json_string | default : '""'}} + }, + {% endif -%} + {% if c.itemReference -%} + { + "url" : "http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content", + "valueReference": {{c.itemReference |to_json_string | default : '""'}} + }, + {% endif -%} + {% endfor -%} + {% for i in msg.image -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationImage", + "valueAttachment" : {{i | to_json_string | default : '""' }} + }, + {% endfor -%} + ], + "ingredient" : [ {{ msg.ingredient | to_array | batch_render: 'Medication/Ingredient', 'msg' }} ], + "batch" : {{msg.package.batch | to_json_string | default : '""' }}, + "image" : "", + "isOverTheCounter" : "", + "isBrand" : "", + "status" : "", + "package" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Medication/_Ingredient.liquid b/data/Templates/Stu3ToR4/Medication/_Ingredient.liquid new file mode 100644 index 000000000..793f0f14c --- /dev/null +++ b/data/Templates/Stu3ToR4/Medication/_Ingredient.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "strength" : {{msg.amount | to_json_string | default : '""'}}, + "amount" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MedicationAdministration.liquid b/data/Templates/Stu3ToR4/MedicationAdministration.liquid new file mode 100644 index 000000000..6ee62e8e2 --- /dev/null +++ b/data/Templates/Stu3ToR4/MedicationAdministration.liquid @@ -0,0 +1,34 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "instantiates" : {{msg.definition | to_json_string | default : '""'}}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.status -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationAdministration.status", + "valueCode" : "{{msg.status}}" + }, + {% endif -%} + {%if msg.notGiven -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationAdministration.notGiven", + "valueBoolean" : "{{msg.notGiven}}" + }, + {% endif -%} + ], + {% if msg.notGiven -%} + "status" : "not-done", + {% endif -%} + "performer" : [ {{ msg.performer | to_array | batch_render: 'MedicationAdministration/Actor', 'msg' }} ], + "reasonCode" : {{msg.reasonNotGiven | to_json_string | default : '""'}}, + "request" : {{msg.prescription | to_json_string | default : '""'}}, + "dosage" : {% include 'DataType/Dosage' msg: msg.dosage -%}, + "prescription" : "", + "reasonNotGiven" : "", + "definition" : "", + "notGiven" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MedicationAdministration/_Actor.liquid b/data/Templates/Stu3ToR4/MedicationAdministration/_Actor.liquid new file mode 100644 index 000000000..0e9bfb5f0 --- /dev/null +++ b/data/Templates/Stu3ToR4/MedicationAdministration/_Actor.liquid @@ -0,0 +1,16 @@ +{% mergeDiff msg -%} +{ + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.onBehalfOf -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationAdministration.performer.onBehalfOf", + "valueReference" : {{msg.onBehalfOf | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "onBehalfOf" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MedicationDispense.liquid b/data/Templates/Stu3ToR4/MedicationDispense.liquid new file mode 100644 index 000000000..3320ed0b6 --- /dev/null +++ b/data/Templates/Stu3ToR4/MedicationDispense.liquid @@ -0,0 +1,32 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "performer" : [ {{ msg.performer | to_array | batch_render: 'MedicationDispense/Actor', 'msg' }} ], + "dosageInstruction" : [ {{ msg.dosageInstruction | to_array | batch_render: 'DataType/Dosage', 'msg' }} ], + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.notDone -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationDispense.notDone", + "valueBoolean" : "{{msg.notDone}}" + }, + {% endif -%} + {%if msg.notDoneReasonCodeableConcept -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationDispense.notDoneReason", + "valueCodeableConcept" : {{msg.notDoneReasonCodeableConcept | to_json_string | default : '""' }} + }, + {% endif -%} + {%if msg.notDoneReasonReference -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationDispense.notDoneReason", + "valueReference" : {{msg.notDoneReasonReference | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "notDone" : "", + "notDoneReasonReference[x]" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MedicationDispense/_Actor.liquid b/data/Templates/Stu3ToR4/MedicationDispense/_Actor.liquid new file mode 100644 index 000000000..e850d63eb --- /dev/null +++ b/data/Templates/Stu3ToR4/MedicationDispense/_Actor.liquid @@ -0,0 +1,16 @@ +{% mergeDiff msg -%} +{ + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.onBehalfOf -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationDispense.performer.onBehalfOf", + "valueReference" : {{msg.onBehalfOf | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "onBehalfOf" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MedicationRequest.liquid b/data/Templates/Stu3ToR4/MedicationRequest.liquid new file mode 100644 index 000000000..c56120c96 --- /dev/null +++ b/data/Templates/Stu3ToR4/MedicationRequest.liquid @@ -0,0 +1,23 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "instantiatesCanonical" : {{msg.definition | to_json_string | default : '""'}}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.requester.onBehalfOf -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationRequest.requester.onBehalfOf", + "valueReference" : {{msg.requester.onBehalfOf | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "requester" : {{msg.requester.agent | to_json_string | default : '""'}}, + "dosageInstruction" : [ {{ msg.dosageInstruction | to_array | batch_render: 'DataType/Dosage', 'msg' }} ], + "substitution" : {% include 'MedicationRequest/Subst' msg: msg.substitution -%}, + "context" : "", + "definition" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MedicationRequest/_Subst.liquid b/data/Templates/Stu3ToR4/MedicationRequest/_Subst.liquid new file mode 100644 index 000000000..223c81704 --- /dev/null +++ b/data/Templates/Stu3ToR4/MedicationRequest/_Subst.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "allowedBoolean" : {{msg.allowed}}, + "allowed" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MedicationStatement.liquid b/data/Templates/Stu3ToR4/MedicationStatement.liquid new file mode 100644 index 000000000..92d43c7f5 --- /dev/null +++ b/data/Templates/Stu3ToR4/MedicationStatement.liquid @@ -0,0 +1,33 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.status -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationStatement.status", + "valueCode" : "{{msg.status}}" + }, + {% endif -%} + {%if msg.taken -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-MedicationStatement.taken", + "valueCode" : "{{msg.taken}}" + }, + {% endif -%} + ], + {% if msg.taken == 'n' -%} + "status" : "not-taken", + {% else if msg.taken == 'unk' -%} + "status" : "unknown", + {% endif -%} + {% if msg.reasonNotTaken -%} + "reasonCode" : {{msg.reasonNotTaken | to_json_string | default : '""'}}, + {% endif -%} + "dosage" : [ {{ msg.dosage | to_array | batch_render: 'DataType/Dosage', 'msg' }} ], + "reasonNotTaken" : "", + "taken" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MessageDefinition.liquid b/data/Templates/Stu3ToR4/MessageDefinition.liquid new file mode 100644 index 000000000..87bcd9920 --- /dev/null +++ b/data/Templates/Stu3ToR4/MessageDefinition.liquid @@ -0,0 +1,19 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [{{msg.identifier | to_json_string | default : '""' }}], + "eventCoding" : {{msg.event | to_json_string | default : '""'}}, + "base" : {% include 'DataType/ReferenceToCanonical' msg : msg.parent -%}, + "parent" : {% include 'DataType/ReferenceToCanonical' msg : msg.parent -%}, + "replaces" : [{{msg.replaces | to_array | batch_render : 'DataType/ReferenceToCanonical', 'msg' }}], + "focus" : [{{msg.focus | to_array | batch_render : 'MessageDefinition/Focus', 'msg' }}], + "category" : {% include 'MessageDefinition/TranslateCategoryCode' msg : msg.category -%}, + "allowedResponse" : [{{msg.allowedResponse | to_array | batch_render : 'MessageDefinition/AllowedResponse', 'msg' }}], + {% if msg.responseRequired == true -%} + "responseRequired" : "always", + {% else -%} + "responseRequired" : "never", + {% endif -%} + "event" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MessageDefinition/_AllowedResponse.liquid b/data/Templates/Stu3ToR4/MessageDefinition/_AllowedResponse.liquid new file mode 100644 index 000000000..b4509a84f --- /dev/null +++ b/data/Templates/Stu3ToR4/MessageDefinition/_AllowedResponse.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "message" : {% include 'DataType/ReferenceToCanonical' msg : msg.message -%}, +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MessageDefinition/_Focus.liquid b/data/Templates/Stu3ToR4/MessageDefinition/_Focus.liquid new file mode 100644 index 000000000..d0167ad96 --- /dev/null +++ b/data/Templates/Stu3ToR4/MessageDefinition/_Focus.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "profile" : {% include 'DataType/ReferenceToCanonical' msg : msg.profile -%}, +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MessageDefinition/_TranslateCategoryCode.liquid b/data/Templates/Stu3ToR4/MessageDefinition/_TranslateCategoryCode.liquid new file mode 100644 index 000000000..e0cee947c --- /dev/null +++ b/data/Templates/Stu3ToR4/MessageDefinition/_TranslateCategoryCode.liquid @@ -0,0 +1,8 @@ +{% case msg -%} + {% when "Consequence" -%} + "consequence" + {% when "Currency" -%} + "currency" + {% when "Notification" -%} + "notification" +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/MessageHeader.liquid b/data/Templates/Stu3ToR4/MessageHeader.liquid new file mode 100644 index 000000000..807526a7b --- /dev/null +++ b/data/Templates/Stu3ToR4/MessageHeader.liquid @@ -0,0 +1,19 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "eventCoding" : {{msg.event | to_json_string | default : '""'}}, + "destination" : [ + {% for d in msg.destination -%} + { + "name" : "{{d.name}}", + "target" : {{d.target | to_json_string | default : '""'}}, + "endpoint" : "{{d.endpoint}}", + "receiver" : {{msg.receiver | to_json_string | default : '""'}} + }, + {% endfor -%} + ], + "event" : "", + "timestamp" : "", + "receiver" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/NamingSystem.liquid b/data/Templates/Stu3ToR4/NamingSystem.liquid new file mode 100644 index 000000000..3147bd81a --- /dev/null +++ b/data/Templates/Stu3ToR4/NamingSystem.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "replacedBy" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/NutritionOrder.liquid b/data/Templates/Stu3ToR4/NutritionOrder.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/NutritionOrder.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Observation.liquid b/data/Templates/Stu3ToR4/Observation.liquid index e95c45660..d5cfc0d04 100644 --- a/data/Templates/Stu3ToR4/Observation.liquid +++ b/data/Templates/Stu3ToR4/Observation.liquid @@ -1,9 +1,10 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], "encounter" : {{msg.context | to_json_string | default : '""'}}, "related" : "", "note" : [ - {% include 'Shared/StringToAnnotation' msg: msg.comment -%} + {% include 'DataType/StringToAnnotation' msg: msg.comment -%} ], "comment" : "", "hasMember" : [ diff --git a/data/Templates/Stu3ToR4/OperationDefinition.liquid b/data/Templates/Stu3ToR4/OperationDefinition.liquid index efc19ab71..cc7572ba4 100644 --- a/data/Templates/Stu3ToR4/OperationDefinition.liquid +++ b/data/Templates/Stu3ToR4/OperationDefinition.liquid @@ -1,8 +1,9 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], "affectsState" : "{{msg.idempotent}}", "idempotent" : "", - "base" : {% include 'Shared/ReferenceToCanonical' msg: msg.base -%}, + "base" : {% include 'DataType/ReferenceToCanonical' msg: msg.base -%}, "parameter" : [ {{ msg.parameter | to_array | batch_render: 'OperationDefinition/Parameter', 'msg' }} ] } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/OperationDefinition/_Binding.liquid b/data/Templates/Stu3ToR4/OperationDefinition/_Binding.liquid index 4c5450190..ad0fc7a33 100644 --- a/data/Templates/Stu3ToR4/OperationDefinition/_Binding.liquid +++ b/data/Templates/Stu3ToR4/OperationDefinition/_Binding.liquid @@ -1,6 +1,11 @@ {% mergeDiff msg -%} { - "valueSetReference" : {% include 'Shared/ReferenceToCanonical' msg: msg.valueSetReference -%}, - "valueSet[x]" : "" + {% if msg.valueSetReference -%} + "valueSet" : {% include 'DataType/ReferenceToCanonical' msg: msg.valueSetReference -%}, + {% else if msg.valueSetUri -%} + "valueSet" : "{{msg.valueSetUri}}", + {% endif -%} + "valueSetUri" : "", + "valueSetReference" : "" } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/OperationDefinition/_Parameter.liquid b/data/Templates/Stu3ToR4/OperationDefinition/_Parameter.liquid index 3d251ae26..a14307e7e 100644 --- a/data/Templates/Stu3ToR4/OperationDefinition/_Parameter.liquid +++ b/data/Templates/Stu3ToR4/OperationDefinition/_Parameter.liquid @@ -1,10 +1,10 @@ {% mergeDiff msg -%} { "targetProfile" : [ - {{msg.profile | to_json_string}} + {{msg.profile | to_json_string | default : '""'}} ], "profile" : "", "binding" : {% include 'OperationDefinition/Binding' msg: msg.binding -%}, - "part" : [ {{ msg.part | to_array | batch_render: 'OperationDefinition/parameter', 'msg' }} ] + "part" : [ {{ msg.part | to_array | batch_render: 'OperationDefinition/Parameter', 'msg' }} ] } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/OperationOutcome.liquid b/data/Templates/Stu3ToR4/OperationOutcome.liquid index 1d069a3df..2a9471609 100644 --- a/data/Templates/Stu3ToR4/OperationOutcome.liquid +++ b/data/Templates/Stu3ToR4/OperationOutcome.liquid @@ -1,4 +1,5 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Organization.liquid b/data/Templates/Stu3ToR4/Organization.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Organization.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Parameters.liquid b/data/Templates/Stu3ToR4/Parameters.liquid index a48d9f259..4af5b7868 100644 --- a/data/Templates/Stu3ToR4/Parameters.liquid +++ b/data/Templates/Stu3ToR4/Parameters.liquid @@ -1,5 +1,6 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], "parameter" : [ {{ msg.parameter | to_array | batch_render: 'Parameters/SubParameter', 'msg' }} ] } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Parameters/_SubParameter.liquid b/data/Templates/Stu3ToR4/Parameters/_SubParameter.liquid index 07853c897..3bb0b1280 100644 --- a/data/Templates/Stu3ToR4/Parameters/_SubParameter.liquid +++ b/data/Templates/Stu3ToR4/Parameters/_SubParameter.liquid @@ -1,5 +1,7 @@ {% mergeDiff msg -%} { - "valueMoney" : {% include 'Shared/Money' msg: msg.valueMoney -%} + "valueMoney" : {% include 'DataType/Money' msg: msg.valueMoney -%}, + "resource" : {% include 'Resource' msg: msg.resource -%}, + "part" : [{{msg.part | to_array | batch_render : 'Parameters/SubParameter', 'msg' }}] } -{% endmergeDiff -%} \ No newline at end of file +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/Patient.liquid b/data/Templates/Stu3ToR4/Patient.liquid index 723b9e0d4..c483565d4 100644 --- a/data/Templates/Stu3ToR4/Patient.liquid +++ b/data/Templates/Stu3ToR4/Patient.liquid @@ -1,6 +1,10 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} {% include 'Patient/Animal' msg: msg.animal -%} ], "animal" : "" diff --git a/data/Templates/Stu3ToR4/Patient/_Animal.liquid b/data/Templates/Stu3ToR4/Patient/_Animal.liquid index 7f951264f..6569a87c2 100644 --- a/data/Templates/Stu3ToR4/Patient/_Animal.liquid +++ b/data/Templates/Stu3ToR4/Patient/_Animal.liquid @@ -2,22 +2,25 @@ { "url" : "http://hl7.org/fhir/r4/StructureDefinition/patient-animal", "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} {%if msg.species -%} { "url" : "species", - "valueCodeableConcept" : {{msg.species | to_json_string }} + "valueCodeableConcept" : {{msg.species | to_json_string | default : '""' }} }, {% endif -%} {%if msg.breed -%} { "url" : "breed", - "valueCodeableConcept" : {{msg.breed | to_json_string }} + "valueCodeableConcept" : {{msg.breed | to_json_string | default : '""' }} }, {% endif -%} {%if msg.genderStatus -%} { "url" : "genderStatus", - "valueCodeableConcept" : {{msg.genderStatus | to_json_string }} + "valueCodeableConcept" : {{msg.genderStatus | to_json_string | default : '""' }} }, {% endif -%} ], diff --git a/data/Templates/Stu3ToR4/PaymentNotice.liquid b/data/Templates/Stu3ToR4/PaymentNotice.liquid new file mode 100644 index 000000000..2175fc085 --- /dev/null +++ b/data/Templates/Stu3ToR4/PaymentNotice.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "paymentDate" : "{{msg.statusDate}}", + "recipient" : {{msg.target | to_json_string | default : '""'}}, + "organization" : "", + "target" : "", + "statusDate" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/PaymentReconciliation.liquid b/data/Templates/Stu3ToR4/PaymentReconciliation.liquid new file mode 100644 index 000000000..882c17c27 --- /dev/null +++ b/data/Templates/Stu3ToR4/PaymentReconciliation.liquid @@ -0,0 +1,20 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "paymentIssuer" : {{msg.organization | to_json_string | default : '""'}}, + {% assign value = msg.outcome.coding[0].code -%} + {% if value == 'complete' or value == 'error' or value == 'partial' -%} + "outcome" : "{{value}}", + {% endif -%} + "requestor" : {{msg.requestProvider | to_json_string | default : '""'}}, + "detail" : [ {{ msg.detail | to_array | batch_render: 'PaymentReconciliation/PaymentReconciliationDetail', 'msg' }} ], + "formCode" : {{msg.form | to_json_string | default : '""'}}, + "paymentAmount" : {% include 'DataType/Money' msg: msg.total -%}, + "processNote" : [ {{ msg.processNote | to_array | batch_render: 'PaymentReconciliation/PaymentReconciliationProcessNote', 'msg' }} ], + "total" : "", + "form" : "", + "requestOrganization" : "", + "requestProvider" : "", + "organization" : "" +} +{% endmergeDiff -%} diff --git a/data/Templates/Stu3ToR4/PaymentReconciliation/_PaymentReconciliationDetail.liquid b/data/Templates/Stu3ToR4/PaymentReconciliation/_PaymentReconciliationDetail.liquid new file mode 100644 index 000000000..58ce319e9 --- /dev/null +++ b/data/Templates/Stu3ToR4/PaymentReconciliation/_PaymentReconciliationDetail.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "amount" : {% include 'DataType/Money' msg: msg.amount -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/PaymentReconciliation/_PaymentReconciliationProcessNote.liquid b/data/Templates/Stu3ToR4/PaymentReconciliation/_PaymentReconciliationProcessNote.liquid new file mode 100644 index 000000000..8640ca4e4 --- /dev/null +++ b/data/Templates/Stu3ToR4/PaymentReconciliation/_PaymentReconciliationProcessNote.liquid @@ -0,0 +1,4 @@ +{ + "type" : "{{msg.type.coding[0].code}}", + "text" : "{{msg.text}}" +} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Person.liquid b/data/Templates/Stu3ToR4/Person.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Person.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/PlanDefinition.liquid b/data/Templates/Stu3ToR4/PlanDefinition.liquid new file mode 100644 index 000000000..bde24557c --- /dev/null +++ b/data/Templates/Stu3ToR4/PlanDefinition.liquid @@ -0,0 +1,38 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "author" :[ + {% for c in msg.contributor %} + {% if c.type == 'author' -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "editor" :[ + {% for c in msg.contributor %} + {% if c.type == "editor" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "reviewer" :[ + {% for c in msg.contributor %} + {% if c.type == "reviewer" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "endorser" :[ + {% for c in msg.contributor %} + {% if c.type == "endorser" -%} + {% include 'DataType/ContributorToContactDetail' msg : c -%}, + {% endif %} + {% endfor %} + ], + "relatedArtifact" : [ {{ msg.relatedArtifact | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ], + "library" : [ {{ msg.library | to_array | batch_render: 'DataType/ReferenceToCanonical', 'msg' }} ], + "goal" : [ {{ msg.goal | to_array | batch_render: 'PlanDefinition/Goal', 'msg' }} ], + "action" : [ {{ msg.action | to_array | batch_render: 'PlanDefinition/Action', 'msg' }} ], + "contributor" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/PlanDefinition/_Action.liquid b/data/Templates/Stu3ToR4/PlanDefinition/_Action.liquid new file mode 100644 index 000000000..2c462418f --- /dev/null +++ b/data/Templates/Stu3ToR4/PlanDefinition/_Action.liquid @@ -0,0 +1,17 @@ +{% mergeDiff msg -%} +{ + "prefix" : "{{msg.label}}", + "documentation" : [ {{ msg.documentation | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ], + "trigger" : {{msg.triggerDefinition | to_json_string | default : '""'}}, + "condition" : [ {{ msg.condition | to_array | batch_render: 'PlanDefinition/Condition', 'msg' }} ], + "input" : [ {{ msg.input | to_array | batch_render: 'DataType/DataRequirement', 'msg' }} ], + "output" : [ {{ msg.output | to_array | batch_render: 'DataType/DataRequirement', 'msg' }} ], + "type" : {% include 'DataType/CodingToCodeableConcept' msg: msg.type -%}, + "transform" : {% include 'DataType/ReferenceToCanonical' msg: msg.transform -%}, + "dynamicValue" : [ {{ msg.dynamicValue | to_array | batch_render: 'PlanDefinition/DynamicValue', 'msg' }} ], + "action" : [ {{ msg.action | to_array | batch_render: 'PlanDefinition/Action', 'msg' }} ], + "definition" : "", + "triggerDefinition" : "", + "label" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/PlanDefinition/_Condition.liquid b/data/Templates/Stu3ToR4/PlanDefinition/_Condition.liquid new file mode 100644 index 000000000..7191fded7 --- /dev/null +++ b/data/Templates/Stu3ToR4/PlanDefinition/_Condition.liquid @@ -0,0 +1,15 @@ +{% mergeDiff msg -%} +{ + "expression" : { + "description" : "{{msg.description}}" + }, + "expression" : { + "language" : "{{msg.language}}" + }, + "expression" : { + "expression" : "{{msg.expression}}" + }, + "language" : "", + "description" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/PlanDefinition/_DynamicValue.liquid b/data/Templates/Stu3ToR4/PlanDefinition/_DynamicValue.liquid new file mode 100644 index 000000000..f16fb52be --- /dev/null +++ b/data/Templates/Stu3ToR4/PlanDefinition/_DynamicValue.liquid @@ -0,0 +1,12 @@ +{% mergeDiff msg -%} +{ + "expression" : { + "description" : "{{msg.description}}", + "language" : "{{msg.language}}", + "expression" : "{{msg.expression}}" + }, + "language" : "", + "description" : "" +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/PlanDefinition/_Goal.liquid b/data/Templates/Stu3ToR4/PlanDefinition/_Goal.liquid new file mode 100644 index 000000000..2d3c8d2c6 --- /dev/null +++ b/data/Templates/Stu3ToR4/PlanDefinition/_Goal.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "documentation" : [ {{ msg.documentation | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Practitioner.liquid b/data/Templates/Stu3ToR4/Practitioner.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Practitioner.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/PractitionerRole.liquid b/data/Templates/Stu3ToR4/PractitionerRole.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/PractitionerRole.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Procedure.liquid b/data/Templates/Stu3ToR4/Procedure.liquid new file mode 100644 index 000000000..a2938ad44 --- /dev/null +++ b/data/Templates/Stu3ToR4/Procedure.liquid @@ -0,0 +1,17 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + {% if msg.notDone == true -%} + "status" : "not-done", + {% else -%} + "status" : {% include 'Procedure/TranslateStatusCode' msg: msg.status -%}, + {% endif -%} + "statusReason" : {{msg.notDoneReason | to_json_string | default : '""'}}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "performer" : [ {{ msg.performer | to_array | batch_render: 'Procedure/ProcedurePerformer', 'msg' }} ], + "context" : "", + "notDone" : "", + "notDoneReason" : "", + "definition" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Procedure/_ProcedurePerformer.liquid b/data/Templates/Stu3ToR4/Procedure/_ProcedurePerformer.liquid new file mode 100644 index 000000000..aa9e1b726 --- /dev/null +++ b/data/Templates/Stu3ToR4/Procedure/_ProcedurePerformer.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "function" : {{msg.role | to_json_string | default : '""'}}, + "role" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Procedure/_TranslateStatusCode.liquid b/data/Templates/Stu3ToR4/Procedure/_TranslateStatusCode.liquid new file mode 100644 index 000000000..394df04f6 --- /dev/null +++ b/data/Templates/Stu3ToR4/Procedure/_TranslateStatusCode.liquid @@ -0,0 +1,15 @@ +{% case msg -%} + {% when "unknown" -%} + "unknown" + {% when "in-progress" -%} + "in-progress" + {% when "suspended" -%} + "suspended" + {% when "aborted" -%} + "stopped" + {% when "completed" -%} + "completed" + {% when "entered-in-error" -%} + "entered-in-error" +{% endcase -%} + diff --git a/data/Templates/Stu3ToR4/Provenance.liquid b/data/Templates/Stu3ToR4/Provenance.liquid new file mode 100644 index 000000000..c3465f581 --- /dev/null +++ b/data/Templates/Stu3ToR4/Provenance.liquid @@ -0,0 +1,12 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "occurredPeriod" : {{msg.period | to_json_string | default : '""'}}, + "reason" : [ {{ msg.reason | to_array | batch_render: 'DataType/CodingToCodeableConcept', 'msg' }} ], + "activity" : {% include 'DataType/CodingToCodeableConcept' msg: msg.activity -%}, + "agent" : [ {{ msg.agent | to_array | batch_render: 'Provenance/Agent', 'msg' }} ], + "entity" : [ {{ msg.entity | to_array | batch_render: 'Provenance/Entity', 'msg' }} ], + "signature" : [ {{ msg.signature | to_array | batch_render: 'DataType/Signature', 'msg' }} ], + "period" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Provenance/_Agent.liquid b/data/Templates/Stu3ToR4/Provenance/_Agent.liquid new file mode 100644 index 000000000..1553b4e22 --- /dev/null +++ b/data/Templates/Stu3ToR4/Provenance/_Agent.liquid @@ -0,0 +1,34 @@ +{% mergeDiff msg -%} +{ + "onBehalfOf[x]" : "", + "who[x]" : "", + {%if msg.whoUri -%} + "who" : { + "reference" : "{{msg.whoUri}}", + "extension" : [ + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/BaseType", + "valueString" : "uri" + } + ] + }, + {% else if msg.whoReference -%} + "who" : {{msg.whoReference |to_json_string | default : '""'}}, + {% endif -%} + {%if msg.onBehalfOfUri -%} + "onBehalfOf" : { + "reference" : "{{msg.onBehalfOfUri}}", + "extension" : [ + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/BaseType", + "valueString" : "uri" + } + ] + }, + {% else if msg.onBehalfOfReference -%} + "onBehalfOf" : {{msg.onBehalfOfReference |to_json_string | default : '""'}}, + {% endif -%} + "type" : {{msg.relatedAgentType | to_json_string | default : '""'}}, + "relatedAgentType" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Provenance/_Entity.liquid b/data/Templates/Stu3ToR4/Provenance/_Entity.liquid new file mode 100644 index 000000000..f901aedea --- /dev/null +++ b/data/Templates/Stu3ToR4/Provenance/_Entity.liquid @@ -0,0 +1,21 @@ +{% mergeDiff msg -%} +{ + "what[x]" : "", + {%if msg.whatUri -%} + "what" : { + "reference" : "{{msg.whatUri}}", + "extension" : [ + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/BaseType", + "valueString" : "uri" + } + ] + }, + {% else if msg.whatReference -%} + "what" : {{msg.whatReference |to_json_string | default : '""'}}, + {% else if msg.whatIdentifier -%} + "what" : {{msg.whatIdentifier |to_json_string | default : '""'}}, + {% endif -%} + "agent" : [ {{ msg.agent | to_array | batch_render: 'Provenance/Agent', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Questionnaire.liquid b/data/Templates/Stu3ToR4/Questionnaire.liquid new file mode 100644 index 000000000..061c440ba --- /dev/null +++ b/data/Templates/Stu3ToR4/Questionnaire.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "item" : [ {{ msg.item | to_array | batch_render: 'Questionnaire/Item', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Questionnaire/_EnableWhen.liquid b/data/Templates/Stu3ToR4/Questionnaire/_EnableWhen.liquid new file mode 100644 index 000000000..ab2f5d3a9 --- /dev/null +++ b/data/Templates/Stu3ToR4/Questionnaire/_EnableWhen.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + {% if msg.answer == null -%} + "answerBoolean" : {{msg.hasAnswer}}, + "operator" : "exists", + {% else -%} + "operator" : "=", + {% endif -%} + "hasAnswer" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Questionnaire/_Initial.liquid b/data/Templates/Stu3ToR4/Questionnaire/_Initial.liquid new file mode 100644 index 000000000..64e836071 --- /dev/null +++ b/data/Templates/Stu3ToR4/Questionnaire/_Initial.liquid @@ -0,0 +1,18 @@ +{% mergeDiff msg -%} +{ + "valueBoolean" : {{msg.initialBoolean}}, + "valueDecimal" : {{msg.initialDecimal}}, + "valueInteger" : {{msg.initialInteger}}, + "valueDate" : "{{msg.initialDate}}", + "valueDateTime" : "{{msg.initialDateTime}}", + "valueTime" : "{{msg.initialTime}}", + "valueString" : "{{msg.initialString}}", + "valueUri" : "{{msg.initialUri}}", + "valueAttachment" : {{msg.initialAttachment | to_json_string | default : '""'}}, + "valueCoding" : {{msg.initialCoding | to_json_string | default : '""'}}, + "valueQuantity" : {{msg.initialQuantity | to_json_string | default : '""'}}, + "valueReference" : {{msg.initialReference | to_json_string | default : '""'}}, + "initial[x]" : "", +} +{% endmergeDiff -%} + diff --git a/data/Templates/Stu3ToR4/Questionnaire/_Item.liquid b/data/Templates/Stu3ToR4/Questionnaire/_Item.liquid new file mode 100644 index 000000000..acc0351a0 --- /dev/null +++ b/data/Templates/Stu3ToR4/Questionnaire/_Item.liquid @@ -0,0 +1,14 @@ +{% mergeDiff msg -%} +{ + "enableWhen" : [ {{ msg.enableWhen | to_array | batch_render: 'Questionnaire/EnableWhen', 'msg' }} ], + "answerValueSet" : {% include 'DataType/ReferenceToCanonical' msg : msg.options -%}, + "answerOption" : {{msg.option | to_json_string | default : '""' }}, + "initial" : [ + {% include 'Questionnaire/Initial' msg: msg -%} + ], + "item" : [ {{ msg.item | to_array | batch_render: 'Questionnaire/Item', 'msg' }} ], + "initial[x]" : "", + "option" : "", + "options" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/QuestionnaireResponse.liquid b/data/Templates/Stu3ToR4/QuestionnaireResponse.liquid new file mode 100644 index 000000000..293194d5e --- /dev/null +++ b/data/Templates/Stu3ToR4/QuestionnaireResponse.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "partOf" : {{msg.parent | to_json_string | default : '""'}}, + "questionnaire" : {% include 'DataType/ReferenceToCanonical' msg: msg.questionnaire -%}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "item" : [ {{ msg.item | to_array | batch_render: 'QuestionnaireResponse/Item', 'msg' }} ], + "context" : "", + "parent" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/QuestionnaireResponse/_Answer.liquid b/data/Templates/Stu3ToR4/QuestionnaireResponse/_Answer.liquid new file mode 100644 index 000000000..6c986fd0a --- /dev/null +++ b/data/Templates/Stu3ToR4/QuestionnaireResponse/_Answer.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "item" : [ {{ msg.item | to_array | batch_render: 'QuestionnaireResponse/Item', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/QuestionnaireResponse/_Item.liquid b/data/Templates/Stu3ToR4/QuestionnaireResponse/_Item.liquid new file mode 100644 index 000000000..2860e62b5 --- /dev/null +++ b/data/Templates/Stu3ToR4/QuestionnaireResponse/_Item.liquid @@ -0,0 +1,18 @@ +{% mergeDiff msg -%} +{ + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.subject -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-QuestionnaireResponse.item.subject", + "valueReference" : {{msg.subject | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "answer" : [ {{ msg.answer | to_array | batch_render: 'QuestionnaireResponse/Answer', 'msg' }} ], + "item" : [ {{ msg.item | to_array | batch_render: 'QuestionnaireResponse/Item', 'msg' }} ], + "subject" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/RelatedPerson.liquid b/data/Templates/Stu3ToR4/RelatedPerson.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/RelatedPerson.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/RequestGroup.liquid b/data/Templates/Stu3ToR4/RequestGroup.liquid new file mode 100644 index 000000000..0c98e4b6b --- /dev/null +++ b/data/Templates/Stu3ToR4/RequestGroup.liquid @@ -0,0 +1,13 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "instantiatesCanonical" : [{{msg.definition | to_array | batch_render : 'DataType/ReferenceToCanonical', 'msg'}} ], + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "reasonCode" : [{{msg.reasonCodeableConcept | to_json_string | default : '""' }}], + "reasonReference" : [{{msg.reasonReference | to_json_string | default : '""' }}], + "action" : [ {{ msg.action | to_array | batch_render: 'RequestGroup/Action', 'msg' }} ], + "reasonCodeableConcept" : "", + "context" : "", + "definition" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/RequestGroup/_Action.liquid b/data/Templates/Stu3ToR4/RequestGroup/_Action.liquid new file mode 100644 index 000000000..bcdde0a0a --- /dev/null +++ b/data/Templates/Stu3ToR4/RequestGroup/_Action.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "prefix" : "{{msg.label}}", + "documentation" : [ {{ msg.documentation | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ], + "condition" : [ {{ msg.condition | to_array | batch_render: 'RequestGroup/Condition', 'msg' }} ], + "type" : {% include 'DataType/CodingToCodeableConcept' msg: msg.type -%}, + "action" : [ {{ msg.action | to_array | batch_render: 'RequestGroup/Action', 'msg' }} ], + "label" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/RequestGroup/_Condition.liquid b/data/Templates/Stu3ToR4/RequestGroup/_Condition.liquid new file mode 100644 index 000000000..12a57d0d3 --- /dev/null +++ b/data/Templates/Stu3ToR4/RequestGroup/_Condition.liquid @@ -0,0 +1,11 @@ +{% mergeDiff msg -%} +{ + "expression" : { + "description" : "{{msg.description}}", + "language" : "{{msg.language}}", + "expression" : "{{msg.expression}}" + }, + "language" : "", + "description" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ResearchStudy.liquid b/data/Templates/Stu3ToR4/ResearchStudy.liquid new file mode 100644 index 000000000..f8ab81e9c --- /dev/null +++ b/data/Templates/Stu3ToR4/ResearchStudy.liquid @@ -0,0 +1,20 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "status" : {% include 'ResearchStudy/TranslateStatusCode' msg : msg.status -%}, + "relatedArtifact" : [ {{ msg.relatedArtifact | to_array | batch_render: 'DataType/RelatedArtifact', 'msg' }} ], + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {% for j in msg.jurisdiction -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ResearchStudy.jurisdiction", + "valueCodeableConcept" : {{msg.j | to_json_string | default : '""' }} + }, + {% endfor -%} + ], + "arm" : [ {{ msg.arm | to_array | batch_render: 'ResearchStudy/Arm', 'msg' }} ], + "jurisdiction" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ResearchStudy/_Arm.liquid b/data/Templates/Stu3ToR4/ResearchStudy/_Arm.liquid new file mode 100644 index 000000000..f89f0dc68 --- /dev/null +++ b/data/Templates/Stu3ToR4/ResearchStudy/_Arm.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "type" : {{msg.code | to_json_string | default : '""'}}, + "code" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ResearchStudy/_TranslateStatusCode.liquid b/data/Templates/Stu3ToR4/ResearchStudy/_TranslateStatusCode.liquid new file mode 100644 index 000000000..aa92dad32 --- /dev/null +++ b/data/Templates/Stu3ToR4/ResearchStudy/_TranslateStatusCode.liquid @@ -0,0 +1,14 @@ +{% case msg -%} + {% when "draft" -%} + "in-review" + {% when "in-progress" -%} + "active" + {% when "suspended" -%} + "disapproved" + {% when "stopped" -%} + "withdrawn" + {% when "completed" -%} + "administratively-completed" + {% when "entered-in-error" -%} + "withdrawn" +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ResearchSubject.liquid b/data/Templates/Stu3ToR4/ResearchSubject.liquid new file mode 100644 index 000000000..697359fd8 --- /dev/null +++ b/data/Templates/Stu3ToR4/ResearchSubject.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [ {{msg.identifier | to_json_string | default : '""'}} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Resource.liquid b/data/Templates/Stu3ToR4/Resource.liquid new file mode 100644 index 000000000..996373d32 --- /dev/null +++ b/data/Templates/Stu3ToR4/Resource.liquid @@ -0,0 +1,220 @@ +{% case msg.resourceType -%} + {% when "Account" %} + {% include 'Account' msg %} + {% when "ActivityDefinition" %} + {% include 'ActivityDefinition' msg %} + {% when "Address" %} + {% include 'Address' msg %} + {% when "AdverseEvent" %} + {% include 'AdverseEvent' msg %} + {% when "AllergyIntolerance" %} + {% include 'AllergyIntolerance' msg %} + {% when "Appointment" %} + {% include 'Appointment' msg %} + {% when "AppointmentResponse" %} + {% include 'AppointmentResponse' msg %} + {% when "AuditEvent" %} + {% include 'AuditEvent' msg %} + {% when "Basic" %} + {% include 'Basic' msg %} + {% when "Binary" %} + {% include 'Binary' msg %} + {% when "BodySite" %} + {% include 'BodySite' msg %} + {% when "Bundle" %} + {% include 'Bundle' msg %} + {% when "CapabilityStatement" %} + {% include 'CapabilityStatement' msg %} + {% when "CarePlan" %} + {% include 'CarePlan' msg %} + {% when "CareTeam" %} + {% include 'CareTeam' msg %} + {% when "ChargeItem" %} + {% include 'ChargeItem' msg %} + {% when "Claim" %} + {% include 'Claim' msg %} + {% when "ClaimResponse" %} + {% include 'ClaimResponse' msg %} + {% when "ClinicalImpression" %} + {% include 'ClinicalImpression' msg %} + {% when "CodeSystem" %} + {% include 'CodeSystem' msg %} + {% when "Communication" %} + {% include 'Communication' msg %} + {% when "CommunicationRequest" %} + {% include 'CommunicationRequest' msg %} + {% when "CompartmentDefinition" %} + {% include 'CompartmentDefinition' msg %} + {% when "Composition" %} + {% include 'Composition' msg %} + {% when "ConceptMap" %} + {% include 'ConceptMap' msg %} + {% when "Condition" %} + {% include 'Condition' msg %} + {% when "Consent" %} + {% include 'Consent' msg %} + {% when "Contract" %} + {% include 'Contract' msg %} + {% when "Coverage" %} + {% include 'Coverage' msg %} + {% when "DetectedIssue" %} + {% include 'DetectedIssue' msg %} + {% when "Device" %} + {% include 'Device' msg %} + {% when "DeviceMetric" %} + {% include 'DeviceMetric' msg %} + {% when "DeviceRequest" %} + {% include 'DeviceRequest' msg %} + {% when "DeviceUseStatement" %} + {% include 'DeviceUseStatement' msg %} + {% when "DiagnosticReport" %} + {% include 'DiagnosticReport' msg %} + {% when "DocumentManifest" %} + {% include 'DocumentManifest' msg %} + {% when "DocumentReference" %} + {% include 'DocumentReference' msg %} + {% when "EligibilityRequest" %} + {% include 'EligibilityRequest' msg %} + {% when "EligibilityResponse" %} + {% include 'EligibilityResponse' msg %} + {% when "Encounter" %} + {% include 'Encounter' msg %} + {% when "Endpoint" %} + {% include 'Endpoint' msg %} + {% when "EnrollmentRequest" %} + {% include 'EnrollmentRequest' msg %} + {% when "EnrollmentResponse" %} + {% include 'EnrollmentResponse' msg %} + {% when "EpisodeOfCare" %} + {% include 'EpisodeOfCare' msg %} + {% when "ExplanationOfBenefit" %} + {% include 'ExplanationOfBenefit' msg %} + {% when "FamilyMemberHistory" %} + {% include 'FamilyMemberHistory' msg %} + {% when "Flag" %} + {% include 'Flag' msg %} + {% when "Goal" %} + {% include 'Goal' msg %} + {% when "GraphDefinition" %} + {% include 'GraphDefinition' msg %} + {% when "Group" %} + {% include 'Group' msg %} + {% when "GuidanceResponse" %} + {% include 'GuidanceResponse' msg %} + {% when "HealthcareService" %} + {% include 'HealthcareService' msg %} + {% when "ImagingStudy" %} + {% include 'ImagingStudy' msg %} + {% when "Immunization" %} + {% include 'Immunization' msg %} + {% when "ImmunizationRecommendation" %} + {% include 'ImmunizationRecommendation' msg %} + {% when "ImplementationGuide" %} + {% include 'ImplementationGuide' msg %} + {% when "Library" %} + {% include 'Library' msg %} + {% when "Linkage" %} + {% include 'Linkage' msg %} + {% when "List" %} + {% include 'List' msg %} + {% when "Location" %} + {% include 'Location' msg %} + {% when "Measure" %} + {% include 'Measure' msg %} + {% when "MeasureReport" %} + {% include 'MeasureReport' msg %} + {% when "Media" %} + {% include 'Media' msg %} + {% when "Medication" %} + {% include 'Medication' msg %} + {% when "MedicationAdministration" %} + {% include 'MedicationAdministration' msg %} + {% when "MedicationDispense" %} + {% include 'MedicationDispense' msg %} + {% when "MedicationRequest" %} + {% include 'MedicationRequest' msg %} + {% when "MedicationStatement" %} + {% include 'MedicationStatement' msg %} + {% when "MessageDefinition" %} + {% include 'MessageDefinition' msg %} + {% when "MessageHeader" %} + {% include 'MessageHeader' msg %} + {% when "NamingSystem" %} + {% include 'NamingSystem' msg %} + {% when "NutritionOrder" %} + {% include 'NutritionOrder' msg %} + {% when "Observation" %} + {% include 'Observation' msg %} + {% when "OperationDefinition" %} + {% include 'OperationDefinition' msg %} + {% when "OperationOutcome" %} + {% include 'OperationOutcome' msg %} + {% when "Organization" %} + {% include 'Organization' msg %} + {% when "Parameters" %} + {% include 'Parameters' msg %} + {% when "Patient" %} + {% include 'Patient' msg %} + {% when "PaymentNotice" %} + {% include 'PaymentNotice' msg %} + {% when "PaymentReconciliation" %} + {% include 'PaymentReconciliation' msg %} + {% when "Person" %} + {% include 'Person' msg %} + {% when "PlanDefinition" %} + {% include 'PlanDefinition' msg %} + {% when "Practitioner" %} + {% include 'Practitioner' msg %} + {% when "PractitionerRole" %} + {% include 'PractitionerRole' msg %} + {% when "Procedure" %} + {% include 'Procedure' msg %} + {% when "Provenance" %} + {% include 'Provenance' msg %} + {% when "Questionnaire" %} + {% include 'Questionnaire' msg %} + {% when "QuestionnaireResponse" %} + {% include 'QuestionnaireResponse' msg %} + {% when "RelatedPerson" %} + {% include 'RelatedPerson' msg %} + {% when "RequestGroup" %} + {% include 'RequestGroup' msg %} + {% when "ResearchStudy" %} + {% include 'ResearchStudy' msg %} + {% when "ResearchSubject" %} + {% include 'ResearchSubject' msg %} + {% when "RiskAssessment" %} + {% include 'RiskAssessment' msg %} + {% when "Schedule" %} + {% include 'Schedule' msg %} + {% when "SearchParameter" %} + {% include 'SearchParameter' msg %} + {% when "Sequence" %} + {% include 'Sequence' msg %} + {% when "Slot" %} + {% include 'Slot' msg %} + {% when "Specimen" %} + {% include 'Specimen' msg %} + {% when "StructureDefinition" %} + {% include 'StructureDefinition' msg %} + {% when "StructureMap" %} + {% include 'StructureMap' msg %} + {% when "Subscription" %} + {% include 'Subscription' msg %} + {% when "Substance" %} + {% include 'Substance' msg %} + {% when "SupplyDelivery" %} + {% include 'SupplyDelivery' msg %} + {% when "SupplyRequest" %} + {% include 'SupplyRequest' msg %} + {% when "Task" %} + {% include 'Task' msg %} + {% when "TestReport" %} + {% include 'TestReport' msg %} + {% when "TestScript" %} + {% include 'TestScript' msg %} + {% when "ValueSet" %} + {% include 'ValueSet' msg %} + {% when "VisionPrescription" %} + {% include 'VisionPrescription' msg %} +{% endcase -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/RiskAssessment.liquid b/data/Templates/Stu3ToR4/RiskAssessment.liquid new file mode 100644 index 000000000..3abe643a1 --- /dev/null +++ b/data/Templates/Stu3ToR4/RiskAssessment.liquid @@ -0,0 +1,16 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "reasonCode" : [{{msg.reasonCodeableConcept | to_json_string | default : '""'}}], + "reasonReference" : [{{msg.reasonReference | to_json_string | default : '""'}}], + "note" : [ + { + "text" : "{{msg.comment}}" + } + ], + "reasonCodeableConcept" : "", + "context" : "", + "comment" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Schedule.liquid b/data/Templates/Stu3ToR4/Schedule.liquid new file mode 100644 index 000000000..2ee684055 --- /dev/null +++ b/data/Templates/Stu3ToR4/Schedule.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "serviceCategory" : [{{ msg.serviceCategory | to_json_string | default : '""'}}] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/SearchParameter.liquid b/data/Templates/Stu3ToR4/SearchParameter.liquid new file mode 100644 index 000000000..9efab4173 --- /dev/null +++ b/data/Templates/Stu3ToR4/SearchParameter.liquid @@ -0,0 +1,13 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "component" : [ + {%for item in msg.component -%} + { + "definition" : {% include 'DataType/ReferenceToCanonical' msg: item.definition -%}, + "expression" : "{{item.expression}}" + }, + {% endfor -%} + ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Sequence.liquid b/data/Templates/Stu3ToR4/Sequence.liquid new file mode 100644 index 000000000..74d6e108d --- /dev/null +++ b/data/Templates/Stu3ToR4/Sequence.liquid @@ -0,0 +1,8 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "resourceType" : "MolecularSequence", + "referenceSeq" : {% include 'Sequence/ReferenceSeq' msg:msg.referenceSeq -%}, + "quality" : [ {{ msg.quality | to_array | batch_render: 'Sequence/Quality', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Sequence/_Quality.liquid b/data/Templates/Stu3ToR4/Sequence/_Quality.liquid new file mode 100644 index 000000000..80391a8a8 --- /dev/null +++ b/data/Templates/Stu3ToR4/Sequence/_Quality.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "standardSequence" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Sequence/_ReferenceSeq.liquid b/data/Templates/Stu3ToR4/Sequence/_ReferenceSeq.liquid new file mode 100644 index 000000000..935c0134d --- /dev/null +++ b/data/Templates/Stu3ToR4/Sequence/_ReferenceSeq.liquid @@ -0,0 +1,9 @@ +{% mergeDiff msg -%} +{ + {% if msg.strand == 1 -%} + "strand" : "watson", + {% else -%} + "strand" : "crick", + {% endif -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Shared/_CodeableConceptToCode.liquid b/data/Templates/Stu3ToR4/Shared/_CodeableConceptToCode.liquid deleted file mode 100644 index 3c4ee5864..000000000 --- a/data/Templates/Stu3ToR4/Shared/_CodeableConceptToCode.liquid +++ /dev/null @@ -1,2 +0,0 @@ -{% assign coding = msg.coding | first -%} -"{{coding.code}}" \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Shared/_CodingToCodeableConcept.liquid b/data/Templates/Stu3ToR4/Shared/_CodingToCodeableConcept.liquid deleted file mode 100644 index dbdb330b8..000000000 --- a/data/Templates/Stu3ToR4/Shared/_CodingToCodeableConcept.liquid +++ /dev/null @@ -1,5 +0,0 @@ -[ - { - "coding" : {{msg | to_json_string}} - } -] \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Shared/_Money.liquid b/data/Templates/Stu3ToR4/Shared/_Money.liquid deleted file mode 100644 index dc65f835b..000000000 --- a/data/Templates/Stu3ToR4/Shared/_Money.liquid +++ /dev/null @@ -1,8 +0,0 @@ -{ - "value": "{{msg.value}}", - "currency" : "{{msg.code}}", - "comparator":"", - "unit":"", - "system":"", - "code":"" -} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Slot.liquid b/data/Templates/Stu3ToR4/Slot.liquid new file mode 100644 index 000000000..b839e0093 --- /dev/null +++ b/data/Templates/Stu3ToR4/Slot.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "serviceCategory" : [{{msg.serviceCategory | to_json_string | default : '""'}}] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Specimen.liquid b/data/Templates/Stu3ToR4/Specimen.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Specimen.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/StructureDefinition.liquid b/data/Templates/Stu3ToR4/StructureDefinition.liquid index 432de0dd3..12de843ee 100644 --- a/data/Templates/Stu3ToR4/StructureDefinition.liquid +++ b/data/Templates/Stu3ToR4/StructureDefinition.liquid @@ -1,5 +1,14 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "fhirVersion" : "4.0.1", + "context":[ + {% for c in msg.context -%} + { + "expression" : {{c}} + }, + {% endfor -%} + ], "contextType" : "" } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/StructureMap.liquid b/data/Templates/Stu3ToR4/StructureMap.liquid new file mode 100644 index 000000000..edec8eb2d --- /dev/null +++ b/data/Templates/Stu3ToR4/StructureMap.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "group" : [ {{ msg.group | to_array | batch_render: 'StructureMap/TheGroup', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/StructureMap/_Rule.liquid b/data/Templates/Stu3ToR4/StructureMap/_Rule.liquid new file mode 100644 index 000000000..9da43b411 --- /dev/null +++ b/data/Templates/Stu3ToR4/StructureMap/_Rule.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "source" : [ {{ msg.source | to_array | batch_render: 'StructureMap/TheSource', 'msg' }} ], + "rule" : [ {{ msg.rule | to_array | batch_render: 'StructureMap/Rule', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/StructureMap/_TheGroup.liquid b/data/Templates/Stu3ToR4/StructureMap/_TheGroup.liquid new file mode 100644 index 000000000..1f86b9b56 --- /dev/null +++ b/data/Templates/Stu3ToR4/StructureMap/_TheGroup.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "rule" : [ {{ msg.rule | to_array | batch_render: 'StructureMap/Rule', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/StructureMap/_TheSource.liquid b/data/Templates/Stu3ToR4/StructureMap/_TheSource.liquid new file mode 100644 index 000000000..5f4c447c0 --- /dev/null +++ b/data/Templates/Stu3ToR4/StructureMap/_TheSource.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "defaultValueMoney" : {% include 'DataType/Money' msg: msg.defaultValueMoney -%}, + "defaultValueSignature" : {% include 'DataType/Signature' msg: msg.defaultValueSignature -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Subscription.liquid b/data/Templates/Stu3ToR4/Subscription.liquid new file mode 100644 index 000000000..4029e1e1c --- /dev/null +++ b/data/Templates/Stu3ToR4/Subscription.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "tag" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Substance.liquid b/data/Templates/Stu3ToR4/Substance.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/Substance.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/SupplyDelivery.liquid b/data/Templates/Stu3ToR4/SupplyDelivery.liquid new file mode 100644 index 000000000..980a1f2bb --- /dev/null +++ b/data/Templates/Stu3ToR4/SupplyDelivery.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [ {{msg.identifier | to_json_string | default : '""'}} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/SupplyRequest.liquid b/data/Templates/Stu3ToR4/SupplyRequest.liquid new file mode 100644 index 000000000..1ab17a218 --- /dev/null +++ b/data/Templates/Stu3ToR4/SupplyRequest.liquid @@ -0,0 +1,25 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "identifier" : [ {{msg.identifier | to_json_string | default : '""'}} ], + "itemCodeableConcept" : {{msg.orderedItem.itemCodeableConcept | to_json_string | default : '""'}}, + "itemReference" : {{msg.orderedItem.itemReference | to_json_string | default : '""'}}, + "quantity" : {{msg.orderedItem.quantity | to_json_string | default : '""'}}, + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.requester.onBehalfOf -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-SupplyRequest.requester.onBehalfOf", + "valueReference" : {{msg.requester.onBehalfOf | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "requester" : {{msg.requester.agent | to_json_string | default : '""'}}, + "reasonCode" : [{{msg.reasonCodeableConcept | to_json_string | default : '""' }}], + "reasonReference" : [{{msg.reasonReference | to_json_string | default : '""' }}], + "reasonCodeableConcept" : "", + "orderedItem" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/Task.liquid b/data/Templates/Stu3ToR4/Task.liquid new file mode 100644 index 000000000..165468f29 --- /dev/null +++ b/data/Templates/Stu3ToR4/Task.liquid @@ -0,0 +1,13 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "instantiatesUri" : "{{msg.definitionUri}}", + "instantiatesCanonical" : {% include 'DataType/ReferenceToCanonical' msg : msg.definitionReference -%}, + "encounter" : {{msg.context | to_json_string | default : '""'}}, + "requester" : {{msg.requester.agent | to_json_string | default : '""'}}, + "reasonCode" : {{msg.reason | to_json_string | default : '""'}}, + "reason" : "", + "context" : "", + "definition[x]" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestReport.liquid b/data/Templates/Stu3ToR4/TestReport.liquid new file mode 100644 index 000000000..2a9471609 --- /dev/null +++ b/data/Templates/Stu3ToR4/TestReport.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestScript.liquid b/data/Templates/Stu3ToR4/TestScript.liquid new file mode 100644 index 000000000..94b43d24f --- /dev/null +++ b/data/Templates/Stu3ToR4/TestScript.liquid @@ -0,0 +1,10 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "metadata" : {% include 'TestScript/Metadata' msg: msg.metadata -%}, + "setup" : {% include 'TestScript/Setup' msg: msg.setup -%}, + "test" : [ {{ msg.test | to_array | batch_render: 'TestScript/Test', 'msg' }} ], + "rule" : "", + "ruleset" : "", +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestScript/_Action.liquid b/data/Templates/Stu3ToR4/TestScript/_Action.liquid new file mode 100644 index 000000000..d7ae79dbb --- /dev/null +++ b/data/Templates/Stu3ToR4/TestScript/_Action.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "assert" : {% include 'TestScript/Assert' msg: msg.assert -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestScript/_Assert.liquid b/data/Templates/Stu3ToR4/TestScript/_Assert.liquid new file mode 100644 index 000000000..9924ff402 --- /dev/null +++ b/data/Templates/Stu3ToR4/TestScript/_Assert.liquid @@ -0,0 +1,6 @@ +{% mergeDiff msg -%} +{ + "rule" : "", + "ruleset" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestScript/_Capability.liquid b/data/Templates/Stu3ToR4/TestScript/_Capability.liquid new file mode 100644 index 000000000..79bd42691 --- /dev/null +++ b/data/Templates/Stu3ToR4/TestScript/_Capability.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "capabilities" : {% include 'DataType/ReferenceToCanonical' msg: msg.capabilities -%} +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestScript/_Metadata.liquid b/data/Templates/Stu3ToR4/TestScript/_Metadata.liquid new file mode 100644 index 000000000..853386bfb --- /dev/null +++ b/data/Templates/Stu3ToR4/TestScript/_Metadata.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "capability" : [ {{ msg.capability | to_array | batch_render: 'TestScript/Capability', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestScript/_Setup.liquid b/data/Templates/Stu3ToR4/TestScript/_Setup.liquid new file mode 100644 index 000000000..ec6ec46ee --- /dev/null +++ b/data/Templates/Stu3ToR4/TestScript/_Setup.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "action" : [ {{ msg.action | to_array | batch_render: 'TestScript/Action', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/TestScript/_Test.liquid b/data/Templates/Stu3ToR4/TestScript/_Test.liquid new file mode 100644 index 000000000..ec6ec46ee --- /dev/null +++ b/data/Templates/Stu3ToR4/TestScript/_Test.liquid @@ -0,0 +1,5 @@ +{% mergeDiff msg -%} +{ + "action" : [ {{ msg.action | to_array | batch_render: 'TestScript/Action', 'msg' }} ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/ValueSet.liquid b/data/Templates/Stu3ToR4/ValueSet.liquid index 5cc6b1df2..a364f3570 100644 --- a/data/Templates/Stu3ToR4/ValueSet.liquid +++ b/data/Templates/Stu3ToR4/ValueSet.liquid @@ -1,6 +1,10 @@ {% mergeDiff msg -%} { + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} {%if msg.extensible -%} { "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-ValueSet.extensible", @@ -8,6 +12,6 @@ }, {% endif -%} ], - "extensible" : "" + "extensible" : "", } {% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/VisionPrescription.liquid b/data/Templates/Stu3ToR4/VisionPrescription.liquid new file mode 100644 index 000000000..492ea10d5 --- /dev/null +++ b/data/Templates/Stu3ToR4/VisionPrescription.liquid @@ -0,0 +1,25 @@ +{% mergeDiff msg -%} +{ + "contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ], + "extension" : [ + {% for e in msg.extension -%} + {{ e | to_json_string | default : '""'}}, + {% endfor -%} + {%if msg.reasonCodeableConcept -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-VisionPrescription.Reason", + "valueCodeableConcept" : {{msg.reasonCodeableConcept | to_json_string | default : '""' }} + }, + {% endif -%} + {%if msg.reasonReference -%} + { + "url" : "http://hl7.org/fhir/r3/StructureDefinition/extension-VisionPrescription.Reason", + "valueReference" : {{msg.reasonReference | to_json_string | default : '""' }} + }, + {% endif -%} + ], + "lensSpecification" : [ {{ msg.dispense | to_array | batch_render: 'VisionPrescription/Dispense', 'msg' }} ], + "dispense" : "", + "reason[x]" : "" +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/data/Templates/Stu3ToR4/VisionPrescription/_Dispense.liquid b/data/Templates/Stu3ToR4/VisionPrescription/_Dispense.liquid new file mode 100644 index 000000000..5d829926d --- /dev/null +++ b/data/Templates/Stu3ToR4/VisionPrescription/_Dispense.liquid @@ -0,0 +1,12 @@ +{% mergeDiff msg -%} +{ + "prism" : [ + {% if msg.prism or msg.base -%} + { + "amount" : "{{msg.prism}}", + "base" : "{{msg.base}}" + }, + {% endif -%} + ] +} +{% endmergeDiff -%} \ No newline at end of file diff --git a/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CapabilityStatement.json b/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CapabilityStatement.json index 1d3541d7f..d9ce6b175 100644 --- a/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CapabilityStatement.json +++ b/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CapabilityStatement.json @@ -67,7 +67,7 @@ "description": "main EHR at ACME", "url": "http://10.2.3.4/fhir" }, - "fhirVersion": "1.0.0", + "fhirVersion": "4.0.1", "format": [ "xml", "json" diff --git a/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CodeSystem.json b/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CodeSystem.json index 2d542884c..3cd483680 100644 --- a/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CodeSystem.json +++ b/src/Microsoft.Health.Fhir.Liquid.Converter.FunctionalTests/TestData/Expected/Stu3ToR4/CodeSystem.json @@ -1,82 +1,84 @@ { - "resourceType": "CodeSystem", - "id": "example", - "meta": { - "profile": [ - "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" - ] - }, - "text": { - "status": "generated", - "div": "
CodeSystem "ACME Codes for Cholesterol": This is an example code system that includes \n all the codes for serum cholesterol defined by ACME inc.
\nDeveloped by: FHIR project team (example)
\nPublished for testing on 28-Jan 2016
\nThis code system defines all the ACME codes for serum cholesterol:
\n\n Code\n | \n\n Display\n | \n\n Definition\n | \n
chol-mmol | \nSChol (mmol/L) | \nSerum Cholesterol, in mmol/L | \n
chol-mass | \nSChol (mg/L) | \nSerum Cholesterol, in mg/L | \n
chol | \nSChol | \nSerum Cholesterol | \n
CodeSystem "ACME Codes for Cholesterol": This is an example code system that includes \n all the codes for serum cholesterol defined by ACME inc.
\nDeveloped by: FHIR project team (example)
\nPublished for testing on 28-Jan 2016
\nThis code system defines all the ACME codes for serum cholesterol:
\n\n Code\n | \n\n Display\n | \n\n Definition\n | \n
chol-mmol | \nSChol (mmol/L) | \nSerum Cholesterol, in mmol/L | \n
chol-mass | \nSChol (mg/L) | \nSerum Cholesterol, in mg/L | \n
chol | \nSChol | \nSerum Cholesterol | \n