Medication
The PostAddMedication endpoint is responsible for registering a new medication in the MIMS system.
How to register a medication
HTTP POST Request
| Request Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddMedication |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddMedication" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| MedicationNo | String(25) | Yes | External code of the medication |
| MedicationName | String(40) | Yes | Medication name |
| GraceDays | Integer | No | Grace period days |
| ActiveIngredientNo | String(30) | No | Active ingredient code |
| ActiveIngredientName | String(30) | No | Active ingredient name |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| MedicationCode | Integer | Yes | Internal 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
| Code | Message |
|---|---|
| AMV‑001 | The provided "MedicationNo" already exists! |