How to Compare Associations or Attributes

0
For a school project, we are creating a medication ordering system. I need to check new orders to compare with the patient's allergy list. I have an entity for new medication order with the attribute of the medication name and another entity MEDALLERGY with attribute of the allergy medication name. I have tried to create a list operation to compare the two, and get the error "the type of the second variable A is not (a specialization of) the type of the second variable B." I also have tried to create a decision point to have a yes/no decision but could not figure out that approach. Any advice?   Thanks :)
asked
2 answers
0

Dear Brittany Curet,

 

If you have both MedicationOrder and MEDALLERGY as parameter you can use a decision with $MedicationOrder/Medication Name = $MEDALLERGY/Allergy Medication and set logic for true and false.

 

If you have only MedicationOrder as parameter you can use retrieve action to retrieve MEDALLERGY from the database using XPath [Allergy Medication = $MedicationOrder/Medication Name] you will get the list of MEDALLERGY and implement your logic with it.

 

Hope my answer helps, reach me out for any queries.

answered
0

Dear Brittany Curet,

 

Since you already have the list of MEDALLERGY objects for a specific person and when you receive a new MEDICATIONORDER, you can easily do a retrieval of the MEDALLERGY object and select range as first form the database using the below XPATH constraint.

 

[Account_Medallergy = $Person]

[MedicationName = $MedicationOrder/MedicationName]

 

If the list is empty, then the person doesnot have any allergy to the specific medication. If the list is NOT empty, then allergy exists.

 

Note - Here person is the account for which MEDICATIONORDER is being made.

 

Hope this helps.

 

Regards

Praharaj

answered