ac-fhir-models
Advanced tools
Comparing version 7.9.1 to 7.10.0-rc.0
{ | ||
"name": "ac-fhir-models", | ||
"version": "7.9.1", | ||
"version": "7.10.0-rc.0", | ||
"author": "Henrik Joreteg <henrik@anesthesiacharting.com>", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -6,2 +6,3 @@ // @ts-check | ||
import { | ||
getCodeableConceptProp, | ||
getContainedObjectProp, | ||
@@ -38,2 +39,4 @@ getDirectReferenceProp, | ||
const nsGeneratedCategory = 'https://ns.anesthesiacharting.com/generated' | ||
const compositionFields = { | ||
@@ -49,2 +52,5 @@ resourceType: 'str', | ||
'type.coding.[].display': 'str', | ||
'category.[].coding.[].system': 'str', | ||
'category.[].coding.[].code': 'str', | ||
'category.[].coding.[].display': 'str', | ||
date: 'str', | ||
@@ -189,2 +195,10 @@ 'contained.[].resourceType': 'str', | ||
lastUpdated: 'meta.lastUpdated', | ||
generatedCategory: getCodeableConceptProp({ | ||
propName: 'category', | ||
codingSystem: nsGeneratedCategory, | ||
options: { | ||
hhxMerge: 'From merging two health histories', | ||
hhxCaseExtract: 'Extracted from a case', | ||
}, | ||
}), | ||
}, | ||
@@ -191,0 +205,0 @@ definition: buildDefinition(compositionFields, fhirFieldTypes), |
@@ -48,2 +48,54 @@ // @ts-check | ||
t.test('generated categories', t => { | ||
const composition = hhxDefinition.set( | ||
{ | ||
category: [{ coding: [{ system: 'https://loinc.org', code: 'foo' }] }], | ||
}, | ||
{ generatedCategory: 'hhxMerge' } | ||
) | ||
t.deepEqual(composition.category, [ | ||
{ coding: [{ system: 'https://loinc.org', code: 'foo' }] }, | ||
{ | ||
coding: [ | ||
{ | ||
system: 'https://ns.anesthesiacharting.com/generated', | ||
code: 'hhxMerge', | ||
display: 'From merging two health histories', | ||
}, | ||
], | ||
}, | ||
]) | ||
t.equal(hhxDefinition.getValues(composition).generatedCategory, 'hhxMerge') | ||
const composition2 = hhxDefinition.set(composition, { | ||
generatedCategory: 'hhxCaseExtract', | ||
}) | ||
t.deepEqual(composition2.category, [ | ||
{ coding: [{ system: 'https://loinc.org', code: 'foo' }] }, | ||
{ | ||
coding: [ | ||
{ | ||
system: 'https://ns.anesthesiacharting.com/generated', | ||
code: 'hhxCaseExtract', | ||
display: 'Extracted from a case', | ||
}, | ||
], | ||
}, | ||
]) | ||
t.equal( | ||
hhxDefinition.getValues(composition2).generatedCategory, | ||
'hhxCaseExtract' | ||
) | ||
const composition3 = hhxDefinition.set(composition2, { | ||
generatedCategory: null, | ||
}) | ||
t.deepEqual(composition3.category, [ | ||
{ coding: [{ system: 'https://loinc.org', code: 'foo' }] }, | ||
]) | ||
t.notOk(hhxDefinition.getValues(composition3).generatedCategory) | ||
t.end() | ||
}) | ||
t.end() | ||
@@ -50,0 +102,0 @@ }) |
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
215126
7377
2