How to send PUT using HS.FHIR.DTL.Util.HC.SDA3.FHIR.Process?
Dear,
I'm trying to configure a new interface that reads HL7, transform them into FHIR messages and then send POST or PUT or DELETE depending on HL7 doc type.
1-I added an HL7 TCP service that reads ADTs messages
2a-Send ADTs to a process to transform them into SDA (using the following command: do ##class(HS.Gateway.HL7.HL7ToSDA3).GetSDA(request,.con))
2b-Extract the patient MRN and add it to the AdditionalInfo property (using the following request message class: HS.Message.XMLMessage)
3-Send the SDA message to the built in process: HS.FHIR.DTL.Util.HC.SDA3.FHIR.Process.
4-Send FHIR request to HS.FHIRServer.Interop.Operation
My only problem is that every ADT message is being transformed to a POST FHIR message.
Can you help me to control the method that is being used (POST)? and t change it to a PUT or DELETE when needed?
Hi! You have to define in the HS.FHIRServer.Interop.Request message the property RequestMethod. Take a look to this article.
Thanks Luis, your documentation is rich and really helpful!
I just thought that we might be able to use the built in process instead of re-writing all the code manually... When you say: define in the HS.FHIRServer.Interop.Request message the property.. Can you please clarify where I can do that? As I mentioned earlier I'm using HS.FHIR.DTL.Util.HC.SDA3.FHIR.Process.. Do you suggest to take a copy of it and amend it?
And even if I do that , this class only accept : Ens.StreamContainer and HS.Message.XMLMessage (The one I'm currently using, mentioned in my previous post)
And I noticed that this class has a block of code that handle the PUT method (but I couldn't find anything related to DELETE, and I don't really know how to access the PUT block as all the information are being filled automatically and I'm just passing the SDA message):
Another piece of code:
Do you have any suggestion regarding that? Regarding handling DELETE and PUT methods? Or do you suggest to follow the documentation you provided earlier and write the code manually and disregard this process class?
Sorry for the delay, at the end of your third point your request is a HS.FHIRServer.Interop.Request object, this object has a property called RequestMethod in which you define the method (PUT, POST, DELETE). Define it to PUT and it should work (if your resource has the id assigned by the FHIR server before).
Hi Luis,
Thanks for your response.
1-Does that mean that the current built in process does not support the PUT/DELETE by default and I have to amend the code?
2-In regards to the identifier (id) for patient resources, I attempted to utilize the Medical Record Number (MRN) as the identifier. However, I observed that the FHIR server consistently assigns a different numerical value, potentially through an auto-incrementing mechanism. Does this imply that modifying this identifier is not permissible? Additionally, is it necessary to initiate a GET request to retrieve the resource identifier before executing a PUT request for updating patient information?
PUT and DELETE works, but you have to use as id the generated by FHIR server, you can't use MRN or any other type of id.