Exemplo n.º 1
0
            def callback(channel, method, properties, body):

                body = body.decode("utf-8")
                jsonBody = json.loads(body)

                response = Utilities.createFHIRResource(
                    jsonBody['resource'], body)

                # Because we may have repeat IDs for subscriptions and practitioners as a part of a simulation.
                if (response == 200
                        or (response == 400 and
                            ((jsonBody['resource'] == "Subscription"
                              or jsonBody['resource'] == "Practitioner")))):
                    channel.basic_ack(method.delivery_tag)
                else:
                    print("Error adding FHIR resource: " + str(response))
Exemplo n.º 2
0
 async def post(self, request):
     return Response(
         "", Utilities.createFHIRResource("Condition", await
                                          request.body()), {}, "")
Exemplo n.º 3
0
 async def post(self, request):
     return Response(
         "",
         Utilities.createFHIRResource("MedicationDispense", await
                                      request.body()), {}, "")