Hi, Currently, in the API, we didn't enforce the format for values for the drugoOrder.frequency property, therefore there is a high chance to encounter values with invalid formats when creating a SmartMedication from a DrugOrder, if the existing value was entered in contrast to the OpenMRS suggested format which is to take one of the following 3 forms; 1/daily, 1/weekly and 1/monthly, then we need to take steps when converting it. Below is the proposed way to parse the existing values when converting from DrugOrder to SmartMedication;
Create 3 constants to match weekly, daily and monthly and then parse the value of the frequency property to check if it ends with any of these and set the smartMedication.frequency property accordingly to match the Smart spec formats, if not we throw an exception telling the user that an invalid frequency was found and that the admin should fix it first. I will also go ahead to create a ticket for adding this enforcement into the orders API, we also need to have this added to the new order entry API. Wyclif _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

