Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add r3r4 templates #357

Merged
merged 18 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions data/Templates/Stu3R4/Account/_Account.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}
Original file line number Diff line number Diff line change
@@ -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 'Shared/Contributor2ContactDetail' msg : c -%},
{% endif %}
{% endfor %}
],
"editor" :[
{% for c in msg.contributor %}
{% if c.type == "editor" -%}
{% include 'Shared/Contributor2ContactDetail' msg : c -%},
{% endif %}
{% endfor %}
],
"reviewer" :[
{% for c in msg.contributor %}
{% if c.type == "reviewer" -%}
{% include 'Shared/Contributor2ContactDetail' msg : c -%},
{% endif %}
{% endfor %}
],
"endorser" :[
{% for c in msg.contributor %}
{% if c.type == "endorser" -%}
{% include 'Shared/Contributor2ContactDetail' msg : c -%},
{% endif %}
{% endfor %}
],
"kind" : {% include 'ActivityDefinition/TranslateKindCode' msg : msg.kind -%},
"relatedArtifact" : [ {{ msg.relatedArtifact | to_array | batch_render: 'Shared/RelatedArtifact', 'msg' }} ],
"dosage" : [ {{ msg.dosage | to_array | batch_render: 'Shared/Dosage', 'msg' }} ],
"library" : [ {{ msg.library | to_array | batch_render: 'Shared/Reference2Canonical', 'msg' }} ],
"transform" : {% include 'Shared/Reference2Canonical' msg: msg.transform -%},
"dynamicValue" : [ {{ msg.dynamicValue | to_array | batch_render: 'ActivityDefinition/ActivityDefinitionDynamicValue', 'msg' }} ],
"contributor" : ""
}
{% endmergeDiff -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% mergeDiff msg -%}
{
"expression" : {
"description" : "{{msg.description}}",
"language" : "{{msg.language}}",
"expression" : "{{msg.expression}}"
},
"language" : "",
"description" : ""
}
{% endmergeDiff -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% case msg -%}
{% when "ProcedureRequest" -%}
"ServiceRequest"
{% when "ReferralRequest" -%}
"ServiceRequest"
{% else -%}
"{{msg}}"
{% endcase -%}
5 changes: 5 additions & 0 deletions data/Templates/Stu3R4/Address/_Address.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ],
}
{% endmergeDiff -%}
26 changes: 26 additions & 0 deletions data/Templates/Stu3R4/AdverseEvent/_AdverseEvent.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% mergeDiff msg -%}
{
"causalityResult" : "",
"causalityAuthor" : "",
"causalityMethod" : "",
"causalityProductRelatedness" : "",
"causalityAssessment" : ""
}
{% endmergeDiff -%}
Original file line number Diff line number Diff line change
@@ -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 -%}

11 changes: 11 additions & 0 deletions data/Templates/Stu3R4/Appointment/_Appointment.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ],
}
{% endmergeDiff -%}
9 changes: 9 additions & 0 deletions data/Templates/Stu3R4/AuditEvent/_AuditEvent.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}

8 changes: 8 additions & 0 deletions data/Templates/Stu3R4/AuditEvent/_AuditEventAgent.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% mergeDiff msg -%}
{
"who" : {{msg.reference | to_json_string | default : '""'}},
"who" : {% include 'Shared/Identifier2Reference' msg: msg.userId -%},
"userId" : "",
"reference" : ""
}
{% endmergeDiff -%}
9 changes: 9 additions & 0 deletions data/Templates/Stu3R4/AuditEvent/_AuditEventEntity.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% mergeDiff msg -%}
{
"what" : {% include 'Shared/Identifier2Reference' msg: msg.identifier -%},
"what" : {{msg.reference | to_json_string | default : '""'}},
"detail" : [ {{ msg.detail | to_array | batch_render: 'AuditEvent/AuditEventEntityDetail', 'msg' }} ],
"reference" : "",
"identifier" : ""
}
{% endmergeDiff -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% mergeDiff msg -%}
{
"valueBase64Binary" : "{{msg.value}}",
"value":""
}
{% endmergeDiff -%}
6 changes: 6 additions & 0 deletions data/Templates/Stu3R4/AuditEvent/_AuditEventSource.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% mergeDiff msg -%}
{
"observer" : {% include 'Shared/Identifier2Reference' msg: msg.identifier -%},
"identifier" : ""
}
{% endmergeDiff -%}
5 changes: 5 additions & 0 deletions data/Templates/Stu3R4/Basic/_Basic.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ],
}
{% endmergeDiff -%}
7 changes: 7 additions & 0 deletions data/Templates/Stu3R4/Binary/_Binary.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% mergeDiff msg -%}
{
"contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ],
"data" : "{{msg.content}}",
"content" : ""
}
{% endmergeDiff -%}
10 changes: 10 additions & 0 deletions data/Templates/Stu3R4/BodySite/_BodySite.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}
15 changes: 15 additions & 0 deletions data/Templates/Stu3R4/Bundle.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% if msg.resourceType == 'Bundle' -%}
{% include 'Bundle/Bundle' msg : msg -%}
{% else -%}
{
"resourceType": "Bundle",
"id": "converter",
"type": "message",
"entry": [
{
"fullUrl": "",
"resource": {% include 'Resource' msg -%}
}
]
}
{% endif -%}
6 changes: 6 additions & 0 deletions data/Templates/Stu3R4/Bundle/_Bundle.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}
5 changes: 5 additions & 0 deletions data/Templates/Stu3R4/Bundle/_Entry.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"resource": {% include 'Resource' msg : msg.resource -%}
}
{% endmergeDiff -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% 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",
"valueCode" : "{{msg.acceptUnknown}}"
},
{% endif -%}
],
"fhirVersion": "4.0.1",
Copy link
Contributor

@yankunhuang-pku yankunhuang-pku Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious~ Do we need to update it in other resources?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, it may appear in ImplementationGuide:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be. In this first round of update, I only modify the value of "fhirVersion" field with 'N' priority, and plan to update others for template refinement. (Since value change in Stu3 to R4 is nice to have.)

"profile" : "",
"rest" : [ {{ msg.rest | to_array | batch_render: 'CapabilityStatement/Rest', 'msg' }} ],
"messaging" : [ {{ msg.messaging | to_array | batch_render: 'CapabilityStatement/Messaging', 'msg' }} ],
"document" : [ {{ msg.document | to_array | batch_render: 'CapabilityStatement/Document', 'msg' }} ],
"acceptUnknown" : ""
}
{% endmergeDiff -%}
5 changes: 5 additions & 0 deletions data/Templates/Stu3R4/CapabilityStatement/_Document.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"profile" : {% include 'Shared/Reference2Canonical' msg: msg.profile -%}
}
{% endmergeDiff -%}
6 changes: 6 additions & 0 deletions data/Templates/Stu3R4/CapabilityStatement/_Messaging.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% mergeDiff msg -%}
{
"supportedMessage" : [ {{ msg.supportedMessage | to_array | batch_render: 'CapabilityStatement/SupportedMessage', 'msg' }} ],
"event" : ""
}
{% endmergeDiff -%}
5 changes: 5 additions & 0 deletions data/Templates/Stu3R4/CapabilityStatement/_Resource.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"profile" : {% include 'Shared/Reference2Canonical' msg: msg.profile -%}
}
{% endmergeDiff -%}
6 changes: 6 additions & 0 deletions data/Templates/Stu3R4/CapabilityStatement/_Rest.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% mergeDiff msg -%}
{
"security" : {% include 'CapabilityStatement/Security' msg: msg.security -%},
"resource" : [ {{ msg.resource | to_array | batch_render: 'CapabilityStatement/Resource', 'msg' }} ]
}
{% endmergeDiff -%}
5 changes: 5 additions & 0 deletions data/Templates/Stu3R4/CapabilityStatement/_Security.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"certificate" : ""
}
{% endmergeDiff -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"definition" : {% include 'Shared/Reference2Canonical' msg: msg.definition -%}
}
{% endmergeDiff -%}
5 changes: 5 additions & 0 deletions data/Templates/Stu3R4/CarePlan/_Activity.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% mergeDiff msg -%}
{
"detail" : {% include 'CarePlan/Detail' msg: msg.detail -%}
}
{% endmergeDiff -%}
10 changes: 10 additions & 0 deletions data/Templates/Stu3R4/CarePlan/_CarePlan.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% mergeDiff msg -%}
{
"contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ],
"instantiatesCanonical" : {% include 'Shared/Reference2Canonical'' msg: msg.definition -%},
"encounter" : {{msg.context | to_json_string | default : '""'}},
"activity" : [ {{ msg.activity | to_array | batch_render: 'CarePlan/Activity', 'msg' }} ],
"context" : "",
"definition" : ""
}
{% endmergeDiff -%}
25 changes: 25 additions & 0 deletions data/Templates/Stu3R4/CarePlan/_Detail.liquid
Original file line number Diff line number Diff line change
@@ -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 -%}
7 changes: 7 additions & 0 deletions data/Templates/Stu3R4/CareTeam/_CareTeam.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% mergeDiff msg -%}
{
"contained" : [ {{msg.contained | to_array | batch_render : 'Resource', 'msg'}} ],
"encounter" : {{msg.context | to_json_string | default : '""'}},
"context" : ""
}
{% endmergeDiff -%}
Loading