Name: dre-data
Owner: Amida Technology Solutions
Description: New DRE backend library for working with FHIR data
Created: 2015-08-14 21:51:13.0
Updated: 2016-04-14 15:06:31.0
Pushed: 2015-12-09 21:10:44.0
Size: 175738
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|---|---|
Dmitry Kachaev | 2015-12-01 07:16:34.0 | 2 |
Michael Hiner | 2015-12-09 21:10:44.0 | 58 |
Other Committers
User | Most Recent Commit | # Commits |
---|
client = getClient('http://myFhirServer.com/base');
fhirObject
- fhir object to be serializedsource
- source file. if present the source file will be serialized as a binary objectnt.create(fhirObject, source
ction(objectId){
//returns the id of the created object. e.g. Patient/1/_history/1
console.log(objectId)
ction(error){
onsole.error(error)
fhirObject
- fhir object to be serializedsource
- source file. if present the source file will be serialized as a binary objectnt.create(fhirObject, source
ction(objectId){
//returns the id of the created object. e.g. Patient/1/_history/1
console.log(objectId)
ction(error){
onsole.error(error)
bundle
- a valid fhir transaction objectsource
- source file used to create the transaction (optional)ent.transaction(bundle, source, function(entry){
//entry will be an array of object IDs corresponding to the transaction processed.
unction(error){
nt.deduplicate(patientId, function(errs, matchSet){
// match set will be a javascript object following the structure below
matchSet:
changeType
-
– match - for an object for which an exact match or matches has been found
– update - for an object for which a partial match has been found
– new - for an object for which no matches or partial matches has been foundlhs
- the originating object.rhs
- only present for changeType update, this is the partial match to the lhs objectmatches
- only present for changeType match, this will contain an array of objects that match the lhs object
"changeType": "match",
"lhs": {
"resourceType": "Condition",
"id": "450",
"meta": {
"versionId": "1",
"lastUpdated": "2015-09-21T14:42:59.442+00:00"
},
"patient": {
"reference": "Patient/dupe"
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "233604007",
"display": "Pneumonia"
}
]
},
"category": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "404684003",
"display": "Finding"
}
]
},
"clinicalStatus": "completed",
"onsetPeriod": {
"start": "2007-01-03"
}
},
"matches": [
{
"resourceType": "Condition",
"id": "372",
"meta": {
"versionId": "1",
"lastUpdated": "2015-09-21T14:42:58.833+00:00"
},
"patient": {
"reference": "Patient/dupe"
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "233604007",
"display": "Pneumonia"
}
]
},
"category": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "404684003",
"display": "Finding"
}
]
},
"clinicalStatus": "completed",
"onsetPeriod": {
"start": "2007-01-03"
}
}
]
"changeType": "match",
"lhs": {
"resourceType": "Observation",
"id": "386",
"meta": {
"versionId": "1",
"lastUpdated": "2015-09-21T14:42:58.684+00:00"
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "409586006",
"display": "Complaint"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "233604007",
"display": "Pneumonia"
}
]
},
"appliesPeriod": {
"start": "2008-01-03",
"end": "2008-01-03"
},
"status": "completed",
"identifier": [
{
"value": "ab1791b0-5c71-11db-b0de-0800200c9a66"
}
],
"subject": {
"reference": "Patient/dupe"
}
},
"matches": [
{
"resourceType": "Observation",
"id": "464",
"meta": {
"versionId": "1",
"lastUpdated": "2015-09-21T14:42:59.373+00:00"
},
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "409586006",
"display": "Complaint"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "233604007",
"display": "Pneumonia"
}
]
},
"appliesPeriod": {
"start": "2008-01-03",
"end": "2008-01-03"
},
"status": "completed",
"identifier": [
{
"value": "ab1791b0-5c71-11db-b0de-0800200c9a66"
}
],
"subject": {
"reference": "Patient/dupe"
}
}
]
"changeType": "new",
"lhs": {
"resourceType": "Patient",
"id": "dupe",
"meta": {
"versionId": "2",
"lastUpdated": "2015-09-21T14:42:59.248+00:00"
},
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/us-core-religion",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.5.1076",
"code": "1013",
"display": "Christian (non-Catholic, non-specific)"
}
]
}
},
{
"url": "http://hl7.org/fhir/Profile/us-core#race",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2106-3",
"display": "White"
}
]
}
},
{
"url": "http://hl7.org/fhir/Profile/us-core#ethnicity",
"valueCodeableConcept": {
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2186-5",
"display": "Not Hispanic or Latino"
}
]
}
},
{
"url": "http://hl7.org/fhir/StructureDefinition/birthPlace",
"valueAddress": {
"city": "Beaverton",
"state": "OR",
"postalCode": "97867",
"country": "US"
}
}
],
"text": {
"status": "generated",
"div": "<div><div class=\"hapiHeaderText\"> Isabella Isa <b>JONES </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td>998991</td></tr><tr><td>Address</td><td><span>1357 Amber Drive </span><br /><span>Beaverton </span><span>OR </span><span>US </span></td></tr><tr><td>Date of birth</td><td><span>01 May 1975</span></td></tr></tbody></table></div>"
},
"identifier": [
{
"system": "urn:oid:2.16.840.1.113883.19.5.99999.2",
"value": "998991"
},
{
"system": "urn:oid:2.16.840.1.113883.4.1",
"value": "111-00-2330"
}
],
"name": [
{
"use": "usual",
"family": [
"Jones"
],
"given": [
"Isabella",
"Isa"
]
}
],
"telecom": [
{
"system": "phone",
"value": "(816)276-6909",
"use": "home"
}
],
"gender": "female",
"birthDate": "1975-05-01",
"address": [
{
"use": "home",
"line": [
"1357 Amber Drive"
],
"city": "Beaverton",
"state": "OR",
"postalCode": "97867",
"country": "US"
}
],
"maritalStatus": {
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.5.2",
"code": "M",
"display": "Married"
}
]
},
"contact": [
{
"relationship": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.5.111",
"code": "PRN",
"display": "Parent"
}
]
}
],
"name": {
"family": [
"Jones"
],
"given": [
"Ralph"
]
},
"telecom": [
{
"system": "phone",
"value": "(816)276-6909",
"use": "home"
}
],
"address": {
"line": [
"1357 Amber Drive"
],
"city": "Beaverton",
"state": "OR",
"postalCode": "97867",
"country": "US"
}
},
{
"relationship": [
{
"coding": [
{
"system": "urn:oid:2.16.840.1.113883.5.111",
"code": "GUAR"
}
]
}
],
"name": {
"family": [
"Everyman"
],
"given": [
"Adam",
"Frankie"
]
},
"telecom": [
{
"system": "phone",
"value": "(781)555-1212",
"use": "home"
}
],
"address": {
"use": "home",
"line": [
"17 Daws Rd."
],
"city": "Blue Bell",
"state": "MA",
"postalCode": "02368",
"country": "US"
}
}
],
"communication": [
{
"language": {
"coding": [
{
"code": "en"
}
]
},
"preferred": true
}
],
"managingOrganization": {
"reference": "Organization/413"
}
}
"changeType": "new",
"lhs": {
"resourceType": "Organization",
"id": "413",
"meta": {
"versionId": "1",
"lastUpdated": "2015-09-21T14:42:59.243+00:00"
},
"name": "Community Health and Hospitals",
"telecom": [
{
"system": "phone",
"value": " 555-555-5000",
"use": "work"
}
],
"address": [
{
"line": [
"1001 Village Avenue"
],
"city": "Portland",
"state": "OR",
"postalCode": "99123",
"country": "US"
}
]
}