Skip to content

Commit

Permalink
Remove mocked data.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukanetskhristina committed May 17, 2021
1 parent db8c14e commit 66b454b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 344 deletions.
14 changes: 14 additions & 0 deletions app/components/fhir-data/fhir.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,20 @@ fb.service('fhirService', [
});
});

var hasQuestionnaireResponse = bundle.entry.some(function (item) {
return item.resource.resourceType === "QuestionnaireResponse";
});

if (!hasQuestionnaireResponse) {
bundle.entry.push({
resource: qr,
request: {
method: "POST",
url: "QuestionnaireResponse"
}
});
}

function withQuestionnaire(q) {
thisService.fhir.request({url: '', method: 'POST',
headers: {'Content-Type': 'application/json'},
Expand Down
344 changes: 0 additions & 344 deletions app/fhir-app/fhir-app-content.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,350 +136,6 @@ angular.module('lformsApp')
}).done(function (data) {
fhirService.createQQRObsCond(qData, qr, resArray, qExists, data);
});
// todo: remove mocked data
var data = {
"resourceType": "Bundle",
"id": "SDOHCC-Bundle-HungerVitalSign-Example-1",
"type": "transaction",
"entry": [
{
"fullUrl": "http://hl7.org/fhir/us/sdoh-cc/Observation/SDOHCC-Observation-HungerVitalSign-Example-1",
"resource": {
"resourceType": "Observation",
"id": "SDOHCC-Observation-HungerVitalSign-Example-1",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "social-history",
"display": "Social History"
}
]
},
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "survey",
"display": "Survey"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "88122-7"
}
],
"text": "(I/We) worried whether (my/our) food would run out before (I/we) got money to buy more."
},
"subject": {
"reference": "Patient/pat-53234",
"display": "COLIN ABBAS"
},
"effectivePeriod": {
"start": "2019-08-18T12:31:35.123Z",
"end": "2020-08-18T14:31:36.456Z"
},
"issued": "2020-08-18T15:31:38.111Z",
"valueCodeableConcept": {
"coding": [
{
"code": "LA6729-3",
"display": "Sometimes true"
}
],
"text": "Sometimes true"
},
"derivedFrom": [
{
"reference": "QuestionnaireResponse/QR-1621149062320-3-a4cfdafb19ff3"
}
]
}
},
{
"fullUrl": "http://hl7.org/fhir/us/sdoh-cc/Observation/SDOHCC-Observation-HungerVitalSign-Example-2",
"resource": {
"resourceType": "Observation",
"id": "SDOHCC-Observation-HungerVitalSign-Example-2",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "social-history",
"display": "Social History"
}
]
},
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "survey",
"display": "Survey"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "88123-5"
}
],
"text": "The food that (I/we) bought just didn&#39t last, and (I/we) didn&#39t have money to get more."
},
"subject": {
"reference": "Patient/pat-53234",
"display": "COLIN ABBAS"
},
"effectivePeriod": {
"start": "2019-08-18T12:31:35.123Z",
"end": "2020-08-18T14:31:36.456Z"
},
"issued": "2020-08-18T15:31:38.111Z",
"valueCodeableConcept": {
"coding": [
{
"code": "LA6729-3",
"display": "Sometimes true"
}
],
"text": "Sometimes true"
},
"derivedFrom": [
{
"reference": "QuestionnaireResponse/QR-1621149062320-3-a4cfdafb19ff3"
}
]
}
},
{
"fullUrl": "http://hl7.org/fhir/us/sdoh-cc/Observation/SDOHCC-Observation-HungerVitalSign-Example-3",
"resource": {
"resourceType": "Observation",
"id": "SDOHCC-Observation-HungerVitalSign-Example-3",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "social-history",
"display": "Social History"
}
]
},
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "survey",
"display": "Survey"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "88124-3"
}
],
"text": "Food insecurity risk"
},
"subject": {
"reference": "Patient/pat-53234",
"display": "COLIN ABBAS"
},
"effectivePeriod": {
"start": "2019-08-18T12:31:35.123Z",
"end": "2020-08-18T14:31:36.456Z"
},
"issued": "2020-08-18T15:31:38.111Z",
"valueCodeableConcept": {
"coding": [
{
"code": "LA19952-3",
"display": "At risk"
}
],
"text": "At risk"
},
"derivedFrom": [
{
"reference": "QuestionnaireResponse/QR-1621149062320-3-a4cfdafb19ff3"
},
{
"reference": "Observation/SDOHCC-Observation-HungerVitalSign-Example-1"
},
{
"reference": "Observation/SDOHCC-Observation-HungerVitalSign-Example-2"
}
]
}
},
{
"fullUrl": "http://hl7.org/fhir/us/sdoh-cc/Observation/SDOHCC-Observation-HungerVitalSignGroup-1",
"resource": {
"resourceType": "Observation",
"id": "SDOHCC-Observation-HungerVitalSignGroup-1",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "88121-9"
}
]
},
"hasMember": [
{
"reference": "Observation/SDOHCC-Observation-HungerVitalSign-Example-1"
},
{
"reference": "Observation/SDOHCC-Observation-HungerVitalSign-Example-2"
},
{
"reference": "Observation/SDOHCC-Observation-HungerVitalSign-Example-3"
}
]
}
},
{
"fullUrl": "http://hl7.org/fhir/us/sdoh-cc/Condition/SDOHCC-Condition-HungerVitalSign-Example-1",
"resource": {
"resourceType": "Condition",
"id": "SDOHCC-Condition-HungerVitalSign-Example-1",
"clinicalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code": "active",
"display": "Active"
}
]
},
"verificationStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
"code": "confirmed",
"display": "Confirmed"
}
]
},
"category": [
{
"coding": [
{
"system": "http://hl7.org/fhir/us/core/CodeSystem/condition-category",
"code": "health-concern",
"display": "Health Concern"
}
]
}
],
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "733423003"
}
],
"text": "Food insecurity"
},
"subject": {
"reference": "Patient/pat-53234",
"display": "COLIN ABBAS"
},
"onsetPeriod": {
"start": "2019-08-18T12:31:35.123Z"
},
"evidence": [
{
"detail": [
{
"reference": "Observation/SDOHCC-Observation-HungerVitalSign-Example-3"
}
]
}
]
}
},
{
"fullUrl": "QuestionnaireResponse/QR-1621149062320-3-a4cfdafb19ff3",
"resource": {
"resourceType": "QuestionnaireResponse",
"id": "QR-1621149062320-3-a4cfdafb19ff3",
"meta": {
"profile": [
"http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse|2.7"
],
"tag": [
{
"code": "lformsVersion: 28.1.4"
}
]
},
"status": "completed",
"subject": {
"reference": "Patient/pat-53234",
"display": "COLIN ABBAS"
},
"authored": "2021-05-16T07:11:02.320Z",
"item": [
{
"linkId": "/88122-7",
"text": "(I/We) worried whether (my/our) food would run out before (I/we) got money to buy more.",
"answer": [
{
"valueCoding": {
"code": "LA6729-3",
"display": "Sometimes true"
}
}
]
},
{
"linkId": "/88123-5",
"text": "The food that (I/we) bought just didn't last, and (I/we) didn't have money to get more.",
"answer": [
{
"valueCoding": {
"code": "LA6729-3",
"display": "Sometimes true"
}
}
]
},
{
"linkId": "/88124-3",
"text": "Food insecurity risk",
"answer": [
{
"valueCoding": {
"code": "LA19952-3",
"display": "At risk"
}
}
]
}
]
}
}
]
};
fhirService.createQQRObsCond(qData, qr, resArray, qExists, data);
};


Expand Down

0 comments on commit 66b454b

Please sign in to comment.