Skip to main content

Medication

The PostAddMedication endpoint is responsible for registering a new medication in the MIMS system.


How to register a medication​

HTTP POST Request

Request TypeExample URL
POST{{url_base}}/PostAddMedication
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMedication"

Input Parameters​

ParameterTypeRequiredDescription
MedicationNoString(25)YesExternal code of the medication
MedicationNameString(40)YesMedication name
GraceDaysIntegerNoGrace period days
ActiveIngredientNoString(30)NoActive ingredient code
ActiveIngredientNameString(30)NoActive ingredient name
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists

Return​

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
MedicationCodeIntegerYesInternal medication code generated in the MIMS system

Request Example​

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMedication"' \
--header 'Content-Type: application/json' \
--data '{
"MedicationNo": "MED001",
"MedicationName": "Antibiótico Exemplo",
"GraceDays": 7,
"ActiveIngredientNo": "AI001",
"ActiveIngredientName": "Princípio Ativo Exemplo",
"OverwriteIfExists": true
}'

Response Example​

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"MedicationCode": 123
}

🐞 Possible Errors​

CodeMessage
AMV‑001The provided "MedicationNo" already exists!