ac-fhir-models
Advanced tools
Comparing version 7.1.0 to 7.2.0
@@ -1044,2 +1044,3 @@ 'use strict'; | ||
text: getTextProp(), | ||
lastLogin: getContainedObjectProp('lastLogin', 'text/plain'), | ||
...getSharedProps(), | ||
@@ -1068,3 +1069,3 @@ }, | ||
'contained.[].contentType': 'str', | ||
'contained.[].data': 'str', | ||
'contained.[].data': ['str', 'num'], | ||
'meta.security': 'arr', | ||
@@ -1071,0 +1072,0 @@ 'meta.security.[].system': 'str', |
{ | ||
"name": "ac-fhir-models", | ||
"version": "7.1.0", | ||
"version": "7.2.0", | ||
"author": "Henrik Joreteg <henrik@anesthesiacharting.com>", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -112,2 +112,3 @@ // @ts-check | ||
text: getTextProp(), | ||
lastLogin: getContainedObjectProp('lastLogin', 'text/plain'), | ||
...getSharedProps(), | ||
@@ -136,3 +137,3 @@ }, | ||
'contained.[].contentType': 'str', | ||
'contained.[].data': 'str', | ||
'contained.[].data': ['str', 'num'], | ||
'meta.security': 'arr', | ||
@@ -139,0 +140,0 @@ 'meta.security.[].system': 'str', |
@@ -5,3 +5,4 @@ import test from 'tape' | ||
test('practitionerDefinition', t => { | ||
const practitionerResource = practitionerDefinition.create({ | ||
const dateValue = new Date().valueOf() | ||
let practitionerResource = practitionerDefinition.create({ | ||
name: 'Henrik Joreteg', | ||
@@ -20,2 +21,35 @@ email: 'henrik@joreteg.com', | ||
) | ||
t.deepEqual(practitionerDefinition.getValues(practitionerResource), { | ||
name: 'Henrik Joreteg', | ||
email: 'henrik@joreteg.com', | ||
userId: '', | ||
roles: [], | ||
active: true, | ||
text: '', | ||
mobile: '', | ||
visionId: '', | ||
}) | ||
practitionerResource = practitionerDefinition.set(practitionerResource, { | ||
lastLogin: dateValue, | ||
}) | ||
t.deepEqual( | ||
practitionerResource, | ||
{ | ||
resourceType: 'Practitioner', | ||
name: [{ text: 'Henrik Joreteg' }], | ||
telecom: [{ system: 'email', value: 'henrik@joreteg.com' }], | ||
active: true, | ||
contained: [ | ||
{ | ||
resourceType: 'Binary', | ||
id: 'lastLogin', | ||
contentType: 'text/plain', | ||
data: dateValue, | ||
}, | ||
], | ||
}, | ||
'should produce a practitioner resource' | ||
) | ||
const practitionerInvitation = practitionerDefinition.set( | ||
@@ -36,2 +70,8 @@ practitionerResource, | ||
resourceType: 'Binary', | ||
id: 'lastLogin', | ||
contentType: 'text/plain', | ||
data: dateValue, | ||
}, | ||
{ | ||
resourceType: 'Binary', | ||
id: 'invitation', | ||
@@ -52,2 +92,6 @@ contentType: 'application/json', | ||
) | ||
t.equal( | ||
practitionerDefinition.getValues(practitionerInvitation).lastLogin, | ||
dateValue | ||
) | ||
t.end() | ||
@@ -54,0 +98,0 @@ }) |
130533
4504