Skip to content

Commit

Permalink
fix reference format to meet aidbox expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
mlapshin committed Dec 25, 2018
1 parent a61b401 commit 6f95817
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion transform.go
Expand Up @@ -67,7 +67,7 @@ func transform(node interface{}, trNode map[string]interface{}, tr map[string]in


if len(refcomps) == 2 { if len(refcomps) == 2 {
newref["id"] = refcomps[1] newref["id"] = refcomps[1]
newref["type"] = refcomps[0] newref["resourceType"] = refcomps[0]
} else { } else {
newref["id"] = refstr newref["id"] = refstr
} }
Expand Down
10 changes: 5 additions & 5 deletions transform_test.go
Expand Up @@ -40,12 +40,12 @@ var cases = [][]string{
`{ `{
"resourceType":"CarePlan", "resourceType":"CarePlan",
"careTeam":[ "careTeam":[
{"id":"1","type":"Practitioner","display":"John"}, {"id":"1","resourceType":"Practitioner","display":"John"},
{"id":"2","type":"Practitioner","display":"Ian"} {"id":"2","resourceType":"Practitioner","display":"Ian"}
], ],
"identifier":[ "identifier":[
{"system":"foo","value":"bar"}, {"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{ []string{
Expand All @@ -58,7 +58,7 @@ var cases = [][]string{
`{ `{
"resourceType":"Claim", "resourceType":"Claim",
"information": [ "information": [
{"value": {"Reference": { "type": "Immunization", "id": "123" }}} {"value": {"Reference": { "resourceType": "Immunization", "id": "123" }}}
]}`, ]}`,
}, },
[]string{ []string{
Expand All @@ -69,7 +69,7 @@ var cases = [][]string{
"multipleBirthInteger": 2, "multipleBirthInteger": 2,
"managingOrganization": { "reference": "Organization/1", "display": "ACME corp"} "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", "resourceType":"Patient",
"deceased": { "boolean": true }, "deceased": { "boolean": true },
"multipleBirth": { "integer": 2 }, "multipleBirth": { "integer": 2 },
Expand Down

0 comments on commit 6f95817

Please sign in to comment.