{
  "resourceType": "Bundle",
  "id": "1612963828",
  "meta": {
    "lastUpdated": "2018-05-02T08:58:18.739+00:00"
  },
  "type": "message",
  "entry": [
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/MessageHeader/1612963828",
      "resource": {
        "resourceType": "MessageHeader",
        "id": "1612963828",
        "event": {
          "system": "http://spms.min-saude.pt/pnb/events",
          "code": "10911",
          "display": "PRESCRIPTION_MANAGEMENT"
        },
        "destination": [
          {
            "name": "PIS",
            "endpoint": "3157106"
          }
        ],
        "timestamp": "2018-05-02T08:58:18.739+00:00",
        "source": {
          "name": "PEM",
          "endpoint": "SPMS"
        },
        "focus": [
          {
            "reference": "Provenance/35d06bcf-ae15-46dd-9386-bd96ac2f00bc"
          }
        ]
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/Provenance/35d06bcf-ae15-46dd-9386-bd96ac2f00bc",
      "resource": {
        "resourceType": "Provenance",
        "id": "35d06bcf-ae15-46dd-9386-bd96ac2f00bc",
        "target": [
          {
            "reference": "MedicationRequest/ac98649a-be3f-4748-8f9e-70ab4aaebc9e"
          },
          {
            "reference": "MedicationRequest/cbfc9d5e-f707-4e3e-89e8-59341958d6d4"
          }
        ],
        "recorded": "2018-05-02T08:58:00.619+00:00",
        "activity": {
          "system": "http://hl7.org/fhir/v3/ActStatus",
          "code": "ACTIVE"
        },
        "agent": [
          {
            "role": [
              {
                "coding": [
                  {
                    "system": "http://www.hl7.org/fhir/contractsignertypecodes",
                    "code": "PRIMAUTH"
                  }
                ]
              }
            ],
            "whoReference": {
              "reference": "Practitioner/44988"
            }
          },
          {
            "role": [
              {
                "coding": [
                  {
                    "system": "http://www.hl7.org/fhir/contractsignertypecodes",
                    "code": "PRIMAUTH"
                  }
                ]
              }
            ],
            "whoReference": {
              "reference": "Practitioner/44988"
            }
          }
        ]
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/Patient/42483dc1-c5e0-49a9-8135-cc1d3a4ce5bb",
      "resource": {
        "resourceType": "Patient",
        "id": "42483dc1-c5e0-49a9-8135-cc1d3a4ce5bb",
        "extension": [
          {
            "url": "http://spms.min-saude.pt/fhir/extensions/paciente-migrante",
            "valueBoolean": false
          }
        ],
        "identifier": [
          {
            "system": "http://spms.min-saude.pt/fhir/identifiers/num-sns-paciente",
            "value": "9999999999"
          },
          {
            "system": "http://spms.min-saude.pt/fhir/identifiers/num-sequencial-paciente",
            "value": "9999999"
          }
        ],
        "name": [
          {
            "text": "JOAN SMITH"
          }
        ],
        "gender": "female",
        "birthDate": "1994-03-11",
        "address": [
          {
            "text": "Rua de Cima, nº. 4- 3º ESQº Almada 2810 ALMADA"
          }
        ]
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/Organization/e891793a-0d3f-408a-a62c-569e4d0e485c",
      "resource": {
        "resourceType": "Organization",
        "id": "e891793a-0d3f-408a-a62c-569e4d0e485c",
        "identifier": [
          {
            "system": "http://spms.min-saude.pt/fhir/identifiers/id-instituicao",
            "value": "3157132"
          }
        ]
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/Encounter/b0f35d5b-5f44-42e0-9e9b-eb5a54a1550e",
      "resource": {
        "resourceType": "Encounter",
        "id": "b0f35d5b-5f44-42e0-9e9b-eb5a54a1550e",
        "identifier": [
          {
            "system": "http://spms.min-saude.pt/fhir/identifiers/num-episodio",
            "value": "18056581"
          }
        ],
        "status": "in-progress",
        "type": [
          {
            "coding": [
              {
                "system": "http://spms.min-saude.pt/fhir/identifiers/modulo-episodio",
                "code": "URG"
              }
            ],
            "text": "URG"
          }
        ],
        "serviceProvider": {
          "reference": "Organization/e891793a-0d3f-408a-a62c-569e4d0e485c"
        }
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/Practitioner/44988",
      "resource": {
        "resourceType": "Practitioner",
        "id": "44988",
        "identifier": [
          {
            "system": "http://spms.min-saude.pt/fhir/identifiers/num-ordem-medicos",
            "value": "44988"
          }
        ]
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/Medication/38b7c36d-9fe5-4049-8250-a0a4307821e3",
      "resource": {
        "resourceType": "Medication",
        "id": "38b7c36d-9fe5-4049-8250-a0a4307821e3",
        "code": {
          "coding": [
            {
              "system": "http://infarmed.pt/valueset/infarmed-emb-id",
              "code": "2030913"
            },
            {
              "system": "http://infarmed.pt/valueset/infarmed-dci",
              "code": "9",
              "display": "Amoxicilina + Ácido clavulânico"
            },
            {
              "system": "http://www.whocc.no/atc",
              "code": "J01CR02",
              "display": "amoxicillin and enzyme inhibitor"
            },
            {
              "system": "http://infarmed.pt/valueset/infarmed-cnpem",
              "code": "50003178",
              "display": "Amoxicilina + Ácido clavulânico, 875 mg + 125 mg, Comprimido revestido por película, Blister - 16 unidade(s)"
            }
          ],
          "text": "Amoxicilina + Ácido clavulânico, 875 mg + 125 mg, Comprimido revestido por película, Blister - 16 unidade(s)"
        },
        "isBrand": false,
        "form": {
          "coding": [
            {
              "system": "http://infarmed.pt/valueset/infarmed-forma-farmaceutica",
              "code": "39",
              "display": "Comprimido revestido por película"
            }
          ]
        },
        "package": {
          "container": {
            "coding": [
              {
                "system": "http://spms.min-saude.pt/fhir/valueset/pem-tipo-embalagem",
                "code": "Blister - 16 unidade(s)",
                "display": "Blister - 16 unidade(s)"
              }
            ]
          }
        }
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/MedicationRequest/ac98649a-be3f-4748-8f9e-70ab4aaebc9e",
      "resource": {
        "resourceType": "MedicationRequest",
        "id": "ac98649a-be3f-4748-8f9e-70ab4aaebc9e",
        "extension": [
          {
            "url": "http://spms.min-saude.pt/fhir/extensions/pem-tipo-receita",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-tipo-receita",
                  "code": "RSP"
                }
              ],
              "text": "Receita Desmaterializada"
            }
          },
          {
            "url": "http://spms.min-saude.pt/fhir/extensions/pem-tipo-linha-receita",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-tipo-linha-receita",
                  "code": "LN"
                }
              ]
            }
          },
          {
            "url": "http://spms.min-saude.pt/fhir/extensions/pem-prescription-type",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-prescription-type",
                  "code": "0"
                }
              ],
              "text": "DCI"
            }
          }
        ],
        "identifier": [
          {
            "system": "http://spms.min-saude.pt/fhir/identifiers/pem-linha-receita",
            "value": "1"
          }
        ],
        "groupIdentifier": {
          "system": "http://spms.min-saude.pt/fhir/identifiers/pem-numero-receita",
          "value": "3011000038798057100"
        },
        "status": "active",
        "intent": "order",
        "medicationReference": {
          "reference": "Medication/38b7c36d-9fe5-4049-8250-a0a4307821e3"
        },
        "subject": {
          "reference": "Patient/42483dc1-c5e0-49a9-8135-cc1d3a4ce5bb"
        },
        "context": {
          "reference": "Encounter/b0f35d5b-5f44-42e0-9e9b-eb5a54a1550e"
        },
        "authoredOn": "2018-05-02T08:58:00+00:00",
        "dosageInstruction": [
          {
            "text": "1 cp 12/12",
            "route": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-vias-administracao",
                  "code": "OTH"
                }
              ]
            }
          }
        ],
        "dispenseRequest": {
          "validityPeriod": {
            "start": "2018-05-02",
            "end": "2018-05-02"
          },
          "numberOfRepeatsAllowed": 1,
          "quantity": {
            "value": 1
          }
        }
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/Medication/5cfccffe-7581-4f76-85c3-f887d5f6e3f6",
      "resource": {
        "resourceType": "Medication",
        "id": "5cfccffe-7581-4f76-85c3-f887d5f6e3f6",
        "code": {
          "coding": [
            {
              "system": "http://infarmed.pt/valueset/infarmed-emb-id",
              "code": "1985876"
            },
            {
              "system": "http://infarmed.pt/valueset/infarmed-dci",
              "code": "71",
              "display": "Ibuprofeno"
            },
            {
              "system": "http://www.whocc.no/atc",
              "code": "M02AA13",
              "display": "ibuprofen"
            },
            {
              "system": "http://infarmed.pt/valueset/infarmed-cnpem",
              "code": "50004271",
              "display": "Ibuprofeno, 400 mg, Comprimido revestido por película, Blister - 20 unidade(s)"
            },
            {
              "system": "http://www.whocc.no/atc",
              "code": "M01AE01",
              "display": "ibuprofen"
            }
          ],
          "text": "Ibuprofeno, 400 mg, Comprimido revestido por película, Blister - 20 unidade(s)"
        },
        "isBrand": false,
        "form": {
          "coding": [
            {
              "system": "http://infarmed.pt/valueset/infarmed-forma-farmaceutica",
              "code": "39",
              "display": "Comprimido revestido por película"
            }
          ]
        },
        "package": {
          "container": {
            "coding": [
              {
                "system": "http://spms.min-saude.pt/fhir/valueset/pem-tipo-embalagem",
                "code": "Blister - 20 unidade(s)",
                "display": "Blister - 20 unidade(s)"
              }
            ]
          }
        }
      }
    },
    {
      "fullUrl": "http://spms.min-saude.pt/fhir/MedicationRequest/cbfc9d5e-f707-4e3e-89e8-59341958d6d4",
      "resource": {
        "resourceType": "MedicationRequest",
        "id": "cbfc9d5e-f707-4e3e-89e8-59341958d6d4",
        "extension": [
          {
            "url": "http://spms.min-saude.pt/fhir/extensions/pem-tipo-receita",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-tipo-receita",
                  "code": "RSP"
                }
              ],
              "text": "Receita Desmaterializada"
            }
          },
          {
            "url": "http://spms.min-saude.pt/fhir/extensions/pem-tipo-linha-receita",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-tipo-linha-receita",
                  "code": "LN"
                }
              ]
            }
          },
          {
            "url": "http://spms.min-saude.pt/fhir/extensions/pem-prescription-type",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-prescription-type",
                  "code": "0"
                }
              ],
              "text": "DCI"
            }
          }
        ],
        "identifier": [
          {
            "system": "http://spms.min-saude.pt/fhir/identifiers/pem-linha-receita",
            "value": "2"
          }
        ],
        "groupIdentifier": {
          "system": "http://spms.min-saude.pt/fhir/identifiers/pem-numero-receita",
          "value": "3011000038798057100"
        },
        "status": "active",
        "intent": "order",
        "medicationReference": {
          "reference": "Medication/5cfccffe-7581-4f76-85c3-f887d5f6e3f6"
        },
        "subject": {
          "reference": "Patient/42483dc1-c5e0-49a9-8135-cc1d3a4ce5bb"
        },
        "context": {
          "reference": "Encounter/b0f35d5b-5f44-42e0-9e9b-eb5a54a1550e"
        },
        "authoredOn": "2018-05-02T08:58:00+00:00",
        "dosageInstruction": [
          {
            "text": "1 cp 8/8 às refeições ( 3 dias, depois em SOS)",
            "route": {
              "coding": [
                {
                  "system": "http://spms.min-saude.pt/fhir/valueset/pem-vias-administracao",
                  "code": "OTH"
                }
              ]
            }
          }
        ],
        "dispenseRequest": {
          "validityPeriod": {
            "start": "2018-05-02",
            "end": "2018-05-02"
          },
          "numberOfRepeatsAllowed": 1,
          "quantity": {
            "value": 1
          }
        }
      }
    }
  ]
}