GithubHelp home page GithubHelp logo

Comments (5)

mkizesov avatar mkizesov commented on September 23, 2024

Hi @Henry6789 ,
what is the type of patient.reference?
Could you try to use patient.to_reference() there?

from fhir-py.

mkizesov avatar mkizesov commented on September 23, 2024

Another way suggested by @ruscoder is to just use subject=patient:

device = client.resource(
                "Device",
                identifier={
                    "type": {
                        'coding': [
                            {
                                "system": 'https://hl7.org/fhir/ValueSet/identifier-type',
                                "code": 'SNO'
                            }
                        ]
                    },
                    "value": sn
                },
                subject=patient
            )

from fhir-py.

Henry6789 avatar Henry6789 commented on September 23, 2024

@mkizesov
Type of patient.reference is str, which is ok as far as I know. It's content is like "Patient/100".
Saving observations with the same patient reference works, which means the issue is device related.
The alternative by @ruscoder is very nice (will use this from now on), but the resulting reference is not saved either.
Maybe the issue is caused by the HAPI FHIR server (version 4.1.0) that I'm talking to.
Can you try if you can save a device with patient reference? Thanks in advance!

from fhir-py.

Henry6789 avatar Henry6789 commented on September 23, 2024

Problem solved.
The FHIR server that I'm using (mentioned above) supports FHIR standard R4.0.1.
R4.0.1 uses the 'patient' field to refer to a patient, while later FHIR releases (like 4.6.0) use the 'subject' field.
Sorry for raising an issue here, and thx for the support!

from fhir-py.

mkizesov avatar mkizesov commented on September 23, 2024

You are welcome. Also had a thought that it could be a server-related issue. So I close this issue.

from fhir-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.