Request patient demographics from HIS via HL7? - hl7

I'm working on an application that connects with HIS via the HL7 protocol. The connection is for syncing the patient demographics saved on my application DB with the HIS DB. How do you request patient information of some patient by their ID anytime?
The documents are talking about update trigger: if the patient demographics changes on HIS it sends the new data. Is there a way to request the data anytime?

You can use an ADT-Query ADT^A19
QRY^A19^QRY_A19 Patient Query
MSH Message Header
QRD Query Definition
[ QRF ] Query Filter
for example
MSH|^~\&|KIS||CommServer||200811111017||QRY^A19||P|2.2|
QRD|200811111016|R|I|Q1004|||1^RD|10000437363|DEM|||
You can get back ADR^A19
ADR^A19^ADR_A19 ADT Response
MSH Message Header
MSA Message Acknowledgment
[ERR] Error
[ QAK ] Query Acknowledgment
QRD Query Definition
[ QRF ] Query Filter
{
PID Patient Identification
[{ ROL }] Role
[{ NK1 }] Next of Kin / Associated Parties
PV1 Patient Visit
[ PV2 ] Patient Visit - Additional Info.
[{ ROL }] Role
[{ OBX }] Observation/Result
[{ AL1 }] Allergy Information
[{ DG1 }] Diagnosis Information
[ DRG ] Diagnosis Related Group
[{
PR1 Procedures
[{ ROL }] Role
}]
[{ GT1 }] Guarantor
[{
IN1 Insurance
[ IN2 ] Insurance Additional Info.
[{ ROL }] Role
}]
[ ACC ] Accident Information
}
But beware, not many systems support queries. It should also be noted, that this type of query was withdrawn with the HL7 Version 2.7. From V2.4 on you could use QBPQuery by parameter

Related

Walmart Marketplace Item Variants

I'm trying to set up new items with variant groups via the Walmart marketplace API. I've been able to set up individual items but when I add the info requested for variant groups, The Walmart system wont ingest my items.. I'm using the python requests library with payload data formatted as JSON.
The error message I'm receiving from Walmart (Data Error):
"A variant item must have a Variant Group ID, Variant Attribute Name and 'Is Primary Variant' value. 'Is Primary Variant' should be set to 'Yes' for only one item in a group of variants. Learn more by searching 'Variant Group' in Help documentation to ensure your variant meets all requirements"
The full item spec can be found at: https://developer.walmart.com/image/asdp/us/mp/item/spec/4.4/MP_ITEM_SPEC_4.4.json
Data being sent in "Visible" section:
"Visible": {
"Home Decor, Kitchen, & Other": {
"shortDescription": self.__description,
"mainImageUrl": self.__image_URLs[0],
"productSecondaryImageURL": [
self.__image_URLs[1]
],
"variantGroupId": self.__src_file_name,
"isPrimaryVariant": self.__is_primary_variant,
"variantAttributeNames": [
"size",
"color",
"material"
],
"size": "8x24",
"color": "black",
"material": "wood"
}

Given a groupId and authenticated user, how do I check the user's membership and role (owner vs member) in one network call?

As far as I know, Microsoft Graph lets me query for /groups/{groupid}/members or /groups/{groupid}//owners separately, but not both in one call. Is this possible?
In my context, I know the groupId and the authenticated calling userId. How do I check whether this user belongs to the group and if so, their owner/member role in one network call? Is this possible?
One option to assume would be to expand and include members and owners properties via $expand query option but unfortunately the following query is not supported:
https://graph.microsoft.com/v1.0/groups/{group-id}?$select=owners,members&$expand=owners,members
since max only 1 object is allowed to be expanded per Group resource
JSON batching comes to the rescue here, the following example demonstrates how to retrieve Group members and owners within a single request:
POST https://graph.microsoft.com/v1.0/$batch
Accept: application/json
Content-Type: application/json
{
"requests": [
{
"id": "1",
"method": "GET",
"url": "/groups/{group-id}/members"
},
{
"id": "2",
"method": "GET",
"url": "/groups/{group-id}/owners"
}
]
}

Query in firebase Database in iOS

I work with firebase database, I have the following data,
I need to get all groups names (GName) of a user by his phoneNum, i.e. all groups of specific user, How can I get that in swift 4?
You should consider restructuring your data. If a user belongs to more than one group in your application then you'll probably have to duplicate your user node for every group the user belongs to in your data structure. You can create another JSON object that holds all of the groups that a user belongs to. Here is a sample JSON for you:
{
"users": [{
"xyz123": {
"userId": "xyz123",
"username": "user1",
"phoneNum": "123456",
"groups": [{
"groupId": 1,
"groupName": "aaa"
}, {
"groupId": 2,
"groupName": "bbb"
}]
}
}]
}
As for filtering with the phone number, you can get all users inside a list and filter the result with the phone number criteria
result = result.filter({item.phoneNum == "123456"})
or get phone number of the user to a upper level, call .child() method with the phone number criteria and fetch the specific user.
Also take a look at structuring data part at firebase documentation.
https://firebase.google.com/docs/database/ios/structure-data
Hope that helps.

How to get text response in survey monkey via API

I'm currently getting responses from SurveyMonkey using the v3 APIs...
I'm using the /collectors/{id}/responses/{id}/details call and I successfully getting the resp. BUT the resp has got the IDs and not the text values e.g.
{
"id": "111788228",
"answers": [
{
"choice_id": "828117913"
}
]
}
1) Can I get SM to send me the text answer?
2) If I can't how can I get the text value using the choice_id.
Thanks in advance.
There isn't a way currently to get the Survey text directly with the responses. You'll have to fetch the survey details or the details for a specific question and match the choice ID with the text for that choice on your own.
GET /v3/surveys/<survey_id>
or
GET /v3/surveys/<survey_id>/pages/<page_id>/questions/<question_id>
You'll get a body back with the choices like this:
{
...
"answers": {
"choices": [{
"id": "12345",
"visible": true,
"is_na": false,
"text": "Apples",
"position": 1
}, ...]
},
...
}
Then you can just match the id field with the choice_id field from the response.
Now there is 'bulk' API.
Look at the 'simple' option:
GET /surveys/{id}/responses/bulk?simple=true

Restricting results of $expand parameter in SensorThings API

I am attempting to truncate the results of an $expand parameter from SensorThingsAPI e.g.
http://example.org/v1.0/Things?$expand=Datastreams
However, $top only restricts the trunk of the query (e.g. Things). Is there a way to truncate the results of the 'leaves' of an $expand?
In this case, the server-side pagination should be controlling the 'leaves' of an $expand.
For example, if the service limit 100 entities for each response and the expanded entities (or the collection) have more than 100, the service will return the top 100 entities following a service-defined order. A #iot.nextLink will also be returned, so that the client know how to fetch the next 100 entities (i.e., next page). Using the above query as an example, an example nextLink to retrieve the Datastreams will be
Datastreams#iot.nextLink:"http://URL_to_retrieve_the_next_page/"
You can use this OGC SensorThings sandbox to see an example return of $expand: http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Datastreams?$expand=Observations
The following JSON shows an example response of the following query with $expand: http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Datastreams?$expand=Observations:
{
"#iot.count": 1,
"value": [{
"#iot.id": 8,
"#iot.selfLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Datastreams(8)",
"description": "Daily Water level",
"observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Observation",
"unitOfMeasurement": {
"symbol": "m",
"name": "meter",
"definition": "https://en.wikipedia.org/wiki/Metre"
},
"Observations#iot.nextLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Datastreams(8)/Observations?$top=3&$skip=3",
"Observations#iot.count": 1826,
"Observations": [{
"#iot.id": 1835,
"#iot.selfLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Observations(1835)",
"phenomenonTime": "2015-12-30T16:00:00.000Z",
"result": "1375.44",
"resultTime": null,
"Datastream#iot.navigationLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Observations(1835)/Datastream",
"FeatureOfInterest#iot.navigationLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Observations(1835)/FeatureOfInterest"
}],
"ObservedProperty#iot.navigationLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Datastreams(8)/ObservedProperty",
"Sensor#iot.navigationLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Datastreams(8)/Sensor",
"Thing#iot.navigationLink": "http://scratchpad.sensorup.com/OGCSensorThings/v1.0/Datastreams(8)/Thing"
},{},{}]
}

Resources