- Created by Andrea M, last modified on Jan 14, 2016
Provider Directory Query Interface using Master Files Messages (MFQ Messages)
Medical-Objects uses standard Master Files Queries and Master Files Notifications to query and update its provider directory services. The interface into this service will be documented here as an example of a HL7 based Service.
An Example: This is a lookup for locally based providers with Surname starting with "whit" and firstname starting with "mel"
Request:
MSH|^~\&|Explorer^Explorer:2.20.2 (Build 684)^L|Buderim GE Centre^7C3E3681-91F6-11D2-8F2C-444553540000^GUID|||20060606195210+1000||MFQ^M02|XX06061952133.1422|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS QRD|||||||50|^white^mel|UPIN||ACTIVE~LOCAL
Response:
MSH|^~\&|EQUATORDXTRAY^EQUATORDXTRAY:2.20.2 (Build 667)^L|Buderim GE Centre^7C3E3681-91F6-11D2-8F2C-444553540000^GUID|Explorer^Explorer:2.20.2 (Build 684)^L|Buderim GE Centre^7C3E3681-91F6-11D2-8F2C-444553540000^GUID|20060606195204+1000||MFR^M02|BGC06061952274.7155|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS MSA|AA|XX06061952133.1422 QRD|||||||50|^white^mel|UPIN||ACTIVE~LOCAL MFI|STF STF|2247960^^Medical-Objects|0341616X^^^AUSHICPR^UPIN~MW45560007K^^^Medical-Objects&7C3E3682-91F6-11D2-8F2C-444553540000&GUID^UPIN~MELISSA J WHITE :5368939947^^^AUSPKIKEY~ANDREW K MCINTYRE :5809512774^^^AUSPKIFACILITYKEY|WHITE^MELISSA^J^^DR^^L||F||A||True^^MO_ROUTABLE|(07)54455055^WPN^PH^^^07^54455055~54455047^WPN^FX^^^07^54455047~^NET^Internet^melissa@buderimgastro.com.au|139 King Street^Buderim Gastroenterology Centre^BUDERIM^QLD^4556^AU^O||||||||2312-25^Specialist|P|N||N STF|100436796^^Medical-Objects|0341617H^^^AUSHICPR^UPIN~MW455800093^^^Medical-Objects&7C3E3682-91F6-11D2-8F2C-444553540000&GUID^UPIN|WHITE^MELISSA^^^Dr.^^L||||A||True^^MO_ROUTABLE|(07)54455055^WPN^PH^^^07^54754002~54455047^WPN^FX^^^07^54300440~^NET^Internet^melissa@buderimgastro.com.au|102 Wises Road^Buderim Gastroenterology Centre^MAROOCHYDORE^QLD^4558^AU^O||||||||2312-25^Specialist||N||N
The response uses "STF" segments which are defined in the master files chapter. STF segments contain all the information you need to populate PRD (Provider) segments used in REF messages.
The interface into this service will be documented here. Essentially queries and responses all look alike, its the request parameters that change depending on what is sought.
The Interface Documentation for Queries is Available here: MFQ^M02 interface Documentation
Provider Directory Update interface using Master Files messages (MFN^M02)
These messages allow new entries to be added, updates to existing entries and Activation/Inactivation of entries
This is an example of a request to add/Update an entry - In our case there is no real difference other than the inclusion of the masterID, as this will be unknown with a new entry.
Request:
MSH|^~\&|Explorer^Explorer:2.20.2 (Build 678)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|||20060607214955+1000||MFN^M02|XX06072149543.5523|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS MFI|STF||UPD|20060607214955+1000||AL MFE|MUP|XX06072149543.5523||100100315 STF|100100315^^Medical-Objects|0000000Y^^^AUSHICPR^L~CM45560001L^^^Medical-Objects&7C3E3682-91F6-11D2-8F2C-444553540000&GUID^UPIN|MCINTYRE^JENNA^^^Ms.^^L||||A||False^^MO_ROUTABLE|^WPN^PH^^61^07^1234565~^NET^Internet^junk@medical-objects.com.au~^WPN^FX^^61^07^2345678|4/24 Sutherland Street^^BUDERIM^QLD^4556^AU^O|||||E|||2312-15^Specialist|F|N||N
Response:
MSH|^~\&|EQUATORDXTRAY_STF^EQUATORDXTRAY_STF:2.20.2 (Build 667)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|Explorer^Explorer:2.20.2 (Build 678)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|20060607214955+1000||MFK^M02|STF06072149573.3214|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS MSA|AA|XX06072149543.5523 MFI|100100315||UPD|20060607214955+1000||AL MFA|MUP|XX06072149543.5523||S
If you do not have permissions to update then the request will be accepted and stored, but will not be applied: The primary key returned is "-1" in this case.
MSH|^~\&|EQUATORDXTRAY_STF^EQUATORDXTRAY_STF:2.20.2 (Build 667)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|Explorer^Explorer:2.20.2 (Build 678)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|20060607215920+1000||MFK^M02|STF06072159355.3216|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS MSA|AA|XX06072159325.5529 MFI|-1||UPD|20060607215920+1000||AL MFA|MUP|XX06072159325.5529||S
Provider Directory Updates
The parameters for the update message are simpler:
These are always the same:
MFI.File_Level_Event_Code = "UPD" for update
These vary:
MFE.Record_Level_Event_Code
"MDL": Delete the STF Record MFE.Primary_Key_Value.Identifier identifies the record "MDC": Deactivate the STF record MFE.Primary_Key_Value.Identifier identifies the record "MAC": Reactivate the STF record MFE.Primary_Key_Value.Identifier identifies the record
"MUP": Update a STF Record "MAD": Add a STF Record
These last 2 codes require a STF segment to be present and the record is saved and the Primary Key value?94?is returned in the MFI.MF_Identifier.Identifier so if desired you can then query by the returned ID to get the record as it was saved.
Every user has a security context and these actions require appropriate access rights. Users with HESA PKI tokens who have the token name in their STF record can edit there own record and create new records, within some limits.
This is the STF segment, which is fully documented in the HL7 Manual:
Figure 8-5. STF attributes
1 Primary Key Value (CE) 2 Staff ID Code (CX repeating) 3 Staff Name (XPN repeating) 4 Staff Type (IS repeating) 5 Sex (IS) 6 Date/Time Of Birth (TS) 7 Active/Inactive Flag (ID) 8 Department (CE repeating) 9 Hospital Service (CE repeating) 10 Phone (XTN repeating) 11 Office/Home Address (XAD repeating) 12 Institution Activation Date (CM repeating) 13 Institution Inactivation Date (CM repeating) 14 Backup Person ID (CE repeating) 15 E-Mail Address (ST repeating) 16 Preferred Method Of Contact (CE) 17 Marital Status (CE) 18 Job Title (ST) 19 Job Code/Class (JCC) 20 Employment Status (IS) 21 Additional Insured on Auto (ID) 22 Driver’s License Number (DLN) 23 Copy Auto Ins (ID) 24 Auto Ins. Expires (DT) 25 Date Last DMV Review (DT) 26 Date Next DMV Review (DT)
While PRD segments are used in some messages, they are instance specific, while STF segments are better as a Provider directory container. PRD segments can be populated from STF segments, With this simple set of messages and parameters a functional Provider Directory Service is possible. There is a lot of scope for extending the queries, but this set covers most situations.
Here is an example exchange where a new doctor Dr Mickey Mouse is added and the resulting entry retrieve for viewing.
The new entry is composed and submitted:
MSH|^~\&|Explorer^Explorer:2.20.2 (Build 689)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|||20060624122540+1000||MFN^M02|XX06241225213.2532|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS MFI|STF||UPD|20060624122540+1000||AL MFE|MAD|XX06241225213.2532 STF|||MOUSE^MICKEY^^^Dr.^^L||||A|||^WPN^PH^^61^07^54455055~^WPN^FX^^61^07^54455000|102 Walts Way^The Cartoon Doctor^BUDERIM^QLD^4556^^O||||||||2312-15^Specialist|F|N||N
This is the response from the Server:
MSH|^~\&|EQUATORDXTRAY_STF^EQUATORDXTRAY_STF:2.20.2 (Build 667)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|Explorer^Explorer:2.20.2 (Build 689)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|20060624122540+1000||MFK^M02|STF06241225253.3622|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS MSA|AA|XX06241225213.2532 MFI|100107902||UPD|20060624122540+1000||AL MFA|MAD|XX06241225213.2532||S
This indicates the add succeeded and the new entry is retrieved with a query:
MSH|^~\&|Explorer^Explorer:2.20.2 (Build 689)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|||20060624122540+1000||MFQ^M02|XX06241225583.2533|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS QRD||||100107902|||||100107902|PRIMARY_KEY
This is the response to the query, a new Unique ID "MM45560019W" has been assigned to the Provider entry:
MSH|^~\&|EQUATORDXTRAY_STF^EQUATORDXTRAY_STF:2.20.2 (Build 667)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|Explorer^Explorer:2.20.2 (Build 689)^L|TEST_STF^5F1127AC-467B-4CFD-95E8-7EC1EA0A2585^GUID|20060624122540+1000||MFR^M02|STF06241225623.3623|P|2.3.1^AUS&&ISO^AS4700.2&&L|||||AUS MSA|AA|XX06241225583.2533 QRD||||100107902|||||100107902|PRIMARY_KEY MFI|STF MFE||100107902 STF|100107902^^Medical-Objects|MM45560019W^^^Medical-Objects&7C3E3682-91F6-11D2-8F2C-444553540000&GUID^UPIN|MOUSE^MICKEY^^^Dr.^^L||||A||False^^MO_ROUTABLE|^WPN^PH^^61^07^54455055~^WPN^FX^^61^07^54455000|102 Walts Way^The Cartoon Doctor^BUDERIM^QLD^4556^^O||||||||2312-15^Specialist|F|N||N
- No labels