# Prescription-history list

| **API URL**     | {{url}}/spice-service/prescription-history/list |
| --------------- | ----------------------------------------------- |
| **Method**      | POST                                            |
| **Description** | Prescription-history list                       |

#### **Input:** <a href="#prescription-historylist-input" id="prescription-historylist-input"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                                                                                                                                     |
| --------------------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization(Header) | String   | Yes           | Bearer eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.MCm0mJDfpfjlr10Uok79-kTF7fv9Tn7cI5m2WsRDGUd9VS7iRmfbszjuc1-w5D-PYt9CdVxRMGBQlzYauhnI |

#### **Sample Input 1:** <a href="#prescription-historylist-sampleinput1" id="prescription-historylist-sampleinput1"></a>

{     "latestRequired": true,     "patientTrackId": 1,     "tenantId": 4 }

#### **Output 1:** <a href="#prescription-historylist-output1" id="prescription-historylist-output1"></a>

| **Field Name**              | **Type**  | **Comments**                   |
| --------------------------- | --------- | ------------------------------ |
| `id`                        | Integer   | Country ID                     |
| `prescriptionId`            | BigInt    | prescription Id                |
| `medicationName`            | String    | Medication name                |
| `medicationId`              | BigInt    | Medication Id                  |
| `brandName`                 | String    | Medication brand name          |
| `classificationName`        | String    | Medication classification name |
| `dosageFormName`            | String    | Dosage form name               |
| `dosageUnitName`            | String    | Dosage unit name               |
| `dosageUnitValue`           | String    | Dosage Unit Value              |
| `dosageUnitId`              | BigInt    | Dosage Unit ID                 |
| `dosageFrequencyName`       | String    | Dosage frequency name          |
| `dosageFrequencyId`         | BigInt    | Dosage frequency ID            |
| `prescribedDays`            | Integer   | Medication prescribed days     |
| `endDate`                   | Timestamp | Medication End date            |
| `instructionNote`           | String    | Instruction note               |
| `signature`                 | String    | Prescriber Signature           |
| `remainingPrescriptionDays` | Integer   | Prescription Remaining Days    |
| `prescriptionFilledDays`    | BigInt    | Prescription filled days       |
| `reason`                    | String    | Reason                         |
| `lastRefillDate`            | Timestamp | Last Refill Date               |
| `active`                    | Boolean   | Is Active                      |
| `deleted`                   | Boolean   | Is Deleted                     |

#### **Sample Output 1:** <a href="#prescription-historylist-sampleoutput1" id="prescription-historylist-sampleoutput1"></a>

```
{
    "message": "Got prescription histories.",
    "entity": {
        "patientPrescription": [
            {
                "createdBy": 5,
                "id": 1,
                "updatedBy": 5,
                "createdAt": "2023-05-24T06:24:58+00:00",
                "updatedAt": "2023-05-24T06:24:58+00:00",
                "tenantId": 4,
                "prescriptionId": 1,
                "patientTrackId": 1,
                "patientVisitId": 1,
                "medicationName": "Dolophime",
                "medicationId": 3,
                "brandName": "Antibiotics",
                "classificationName": "Diuretic",
                "dosageFormName": "Tablet",
                "dosageUnitName": "µg",
                "dosageUnitValue": "5",
                "dosageUnitId": 2,
                "dosageFrequencyName": "OM",
                "dosageFrequencyId": 2,
                "prescribedDays": 6,
                "endDate": "2023-05-29T11:54:58+05:30",
                "instructionNote": "In the morning",
                "signature": "/Prescription_Signatures/1_1_20230524062458387_prescsign.jpeg",
                "remainingPrescriptionDays": 6,
                "prescriptionFilledDays": 0,
                "reason": null,
                "lastRefillDate": null,
                "active": true,
                "deleted": false
            },
            {
                "createdBy": 5,
                "id": 2,
                "updatedBy": 5,
                "createdAt": "2023-05-24T06:25:21+00:00",
                "updatedAt": "2023-05-24T06:25:21+00:00",
                "tenantId": 4,
                "prescriptionId": 2,
                "patientTrackId": 1,
                "patientVisitId": 1,
                "medicationName": "Dolo",
                "medicationId": 6,
                "brandName": "Antibiotics",
                "classificationName": "Diuretic",
                "dosageFormName": "Liquid",
                "dosageUnitName": "µg",
                "dosageUnitValue": "6",
                "dosageUnitId": 2,
                "dosageFrequencyName": "TDS",
                "dosageFrequencyId": 1,
                "prescribedDays": 3,
                "endDate": "2023-05-26T11:55:21+05:30",
                "instructionNote": "Three times a day",
                "signature": "/Prescription_Signatures/1_1_20230524062521586_prescsign.jpeg",
                "remainingPrescriptionDays": 3,
                "prescriptionFilledDays": 0,
                "reason": null,
                "lastRefillDate": null,
                "active": true,
                "deleted": false
            },
            {
                "createdBy": 5,
                "id": 3,
                "updatedBy": 5,
                "createdAt": "2023-05-24T06:26:29+00:00",
                "updatedAt": "2023-05-24T06:26:29+00:00",
                "tenantId": 4,
                "prescriptionId": 3,
                "patientTrackId": 1,
                "patientVisitId": 1,
                "medicationName": "Acetolophime",
                "medicationId": 2,
                "brandName": "Biomet",
                "classificationName": "ACE inhibitor",
                "dosageFormName": "Liquid",
                "dosageUnitName": "µg",
                "dosageUnitValue": "9",
                "dosageUnitId": 2,
                "dosageFrequencyName": "TDS",
                "dosageFrequencyId": 1,
                "prescribedDays": 8,
                "endDate": "2023-05-31T11:56:29+05:30",
                "instructionNote": "Three times a day",
                "signature": "/Prescription_Signatures/1_1_20230524062629806_prescsign.jpeg",
                "remainingPrescriptionDays": 8,
                "prescriptionFilledDays": 0,
                "reason": null,
                "lastRefillDate": null,
                "active": true,
                "deleted": false
            }
        ],
        "prescriptionHistoryDates": [
            {
                "visitDate": "2023-05-24T11:37:56+05:30",
                "id": 1
            }
        ]
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```

#### **Sample Input 2:** <a href="#prescription-historylist-sampleinput2" id="prescription-historylist-sampleinput2"></a>

```
{
    "latestRequired": false,
    "patientTrackId": 1,
    "patientVisitId": 1,
    "tenantId": 4
}
```

#### **Output 2:** <a href="#prescription-historylist-output2" id="prescription-historylist-output2"></a>

| **Field Name**           | **Type** | **Comments**                   |
| ------------------------ | -------- | ------------------------------ |
| `id`                     | Number   | Country ID                     |
| `prescriptionId`         | Number   | prescription Id                |
| `medicationName`         | String   | Medication name                |
| `medicationId`           | number   | Medication Id                  |
| `brandName`              | String   | Medication brand name          |
| `classificationName`     | String   | Medication classification name |
| `dosageFormName`         | Number   | dosage form name               |
| `dosageUnitName`         | String   | Dosage unit name               |
| `dosageFrequencyName`    | String   | Dosage frequency name          |
| `dosageFrequencyId`      | Number   | Dosage frequency ID            |
| `prescribedDays`         | Number   | Medication prescribed days     |
| `prescriptionFilledDays` | Number   | Prescription filled days       |

#### **Sample Output 2:** <a href="#prescription-historylist-sampleoutput2" id="prescription-historylist-sampleoutput2"></a>

```
{
    "message": "Got prescription histories.",
    "entity": {
        "patientPrescription": [
            {
                "createdBy": 5,
                "id": 1,
                "updatedBy": 5,
                "createdAt": "2023-05-24T06:24:58+00:00",
                "updatedAt": "2023-05-24T06:24:58+00:00",
                "tenantId": 4,
                "prescriptionId": 1,
                "patientTrackId": 1,
                "patientVisitId": 1,
                "medicationName": "Dolophime",
                "medicationId": 3,
                "brandName": "Antibiotics",
                "classificationName": "Diuretic",
                "dosageFormName": "Tablet",
                "dosageUnitName": "µg",
                "dosageUnitValue": "5",
                "dosageUnitId": 2,
                "dosageFrequencyName": "OM",
                "dosageFrequencyId": 2,
                "prescribedDays": 6,
                "endDate": "2023-05-29T11:54:58+05:30",
                "instructionNote": "In the morning",
                "signature": "/Prescription_Signatures/1_1_20230524062458387_prescsign.jpeg",
                "remainingPrescriptionDays": 6,
                "prescriptionFilledDays": 0,
                "reason": null,
                "lastRefillDate": null,
                "active": true,
                "deleted": false
            },
            {
                "createdBy": 5,
                "id": 2,
                "updatedBy": 5,
                "createdAt": "2023-05-24T06:25:21+00:00",
                "updatedAt": "2023-05-24T06:25:21+00:00",
                "tenantId": 4,
                "prescriptionId": 2,
                "patientTrackId": 1,
                "patientVisitId": 1,
                "medicationName": "Dolo",
                "medicationId": 6,
                "brandName": "Antibiotics",
                "classificationName": "Diuretic",
                "dosageFormName": "Liquid",
                "dosageUnitName": "µg",
                "dosageUnitValue": "6",
                "dosageUnitId": 2,
                "dosageFrequencyName": "TDS",
                "dosageFrequencyId": 1,
                "prescribedDays": 3,
                "endDate": "2023-05-26T11:55:21+05:30",
                "instructionNote": "Three times a day",
                "signature": "/Prescription_Signatures/1_1_20230524062521586_prescsign.jpeg",
                "remainingPrescriptionDays": 3,
                "prescriptionFilledDays": 0,
                "reason": null,
                "lastRefillDate": null,
                "active": true,
                "deleted": false
            },
            {
                "createdBy": 5,
                "id": 3,
                "updatedBy": 5,
                "createdAt": "2023-05-24T06:26:29+00:00",
                "updatedAt": "2023-05-24T06:26:29+00:00",
                "tenantId": 4,
                "prescriptionId": 3,
                "patientTrackId": 1,
                "patientVisitId": 1,
                "medicationName": "Acetolophime",
                "medicationId": 2,
                "brandName": "Biomet",
                "classificationName": "ACE inhibitor",
                "dosageFormName": "Liquid",
                "dosageUnitName": "µg",
                "dosageUnitValue": "9",
                "dosageUnitId": 2,
                "dosageFrequencyName": "TDS",
                "dosageFrequencyId": 1,
                "prescribedDays": 8,
                "endDate": "2023-05-31T11:56:29+05:30",
                "instructionNote": "Three times a day",
                "signature": "/Prescription_Signatures/1_1_20230524062629806_prescsign.jpeg",
                "remainingPrescriptionDays": 8,
                "prescriptionFilledDays": 0,
                "reason": null,
                "lastRefillDate": null,
                "active": true,
                "deleted": false
            }
        ],
        "prescriptionHistoryDates": [
            {
                "visitDate": "2023-05-24T11:37:56+05:30",
                "id": 1
            }
        ]
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://spice.docs.medtroniclabs.org/spice-docs/engineering/api-documentation/spice-services/prescription-history-list-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
