Skip to content
Permalink
Browse files

fix reference format to meet aidbox expectations

  • Loading branch information
mlapshin committed Dec 25, 2018
1 parent a61b401 commit 6f958170144c0bd7bb8aad5fe470ffbd0562ae31
Showing with 6 additions and 6 deletions.
  1. +1 −1 transform.go
  2. +5 −5 transform_test.go
@@ -67,7 +67,7 @@ func transform(node interface{}, trNode map[string]interface{}, tr map[string]in

if len(refcomps) == 2 {
newref["id"] = refcomps[1]
newref["type"] = refcomps[0]
newref["resourceType"] = refcomps[0]
} else {
newref["id"] = refstr
}
@@ -40,12 +40,12 @@ var cases = [][]string{
`{
"resourceType":"CarePlan",
"careTeam":[
{"id":"1","type":"Practitioner","display":"John"},
{"id":"2","type":"Practitioner","display":"Ian"}
{"id":"1","resourceType":"Practitioner","display":"John"},
{"id":"2","resourceType":"Practitioner","display":"Ian"}
],
"identifier":[
{"system":"foo","value":"bar"},
{"system":"foo","value":"baz","assigner":{"id":"42","type":"Practitioner","display":"John Doe"}}
{"system":"foo","value":"baz","assigner":{"id":"42","resourceType":"Practitioner","display":"John Doe"}}
]}`,
},
[]string{
@@ -58,7 +58,7 @@ var cases = [][]string{
`{
"resourceType":"Claim",
"information": [
{"value": {"Reference": { "type": "Immunization", "id": "123" }}}
{"value": {"Reference": { "resourceType": "Immunization", "id": "123" }}}
]}`,
},
[]string{
@@ -69,7 +69,7 @@ var cases = [][]string{
"multipleBirthInteger": 2,
"managingOrganization": { "reference": "Organization/1", "display": "ACME corp"}
}`, `{
"managingOrganization":{"id":"1","type":"Organization","display":"ACME corp"},
"managingOrganization":{"id":"1","resourceType":"Organization","display":"ACME corp"},
"resourceType":"Patient",
"deceased": { "boolean": true },
"multipleBirth": { "integer": 2 },

0 comments on commit 6f95817

Please sign in to comment.
You can’t perform that action at this time.