简体   繁体   English

有没有办法从 FHIR 服务器获取可用于患者 ID 的资源类型列表?

[英]Is there any way to fetch the list of resource types available for a patient id from FHIR Server?

I want the fetch the list of resource types available for a patient from the FHIR server.我想从 FHIR 服务器获取患者可用的资源类型列表。 I tried to fetch the List of items from the Patient.我试图从患者那里获取物品清单。 But it doesn't contain all the resource types available for that particular patient.但它不包含该特定患者可用的所有资源类型。

http://hapi.fhir.org/baseR4/metadata http://hapi.fhir.org/baseR4/metadata

http://wildfhir4.aegis.net/fhir4-0-1/metadata http://wildfhir4.aegis.net/fhir4-0-1/metadata

https://vonk.fire.ly/R4/metadata https://vonk.fire.ly/R4/metadata

I think you're asking this.我想你在问这个。

If you examine any of the reference implementations above.如果您检查上述任何参考实现。 you'll get the CapabilityStatement.您将获得 CapabilityStatement。

You look at the CapabilityStatement, find the Fhir-Resource ("Patient" here), and then any includes and rev-includes.您查看 CapabilityStatement,找到 Fhir-Resource(此处为“Patient”),然后找到任何包含和 rev-includes。

                "type": "Patient",

                "searchInclude": [
                    "Patient:general-practitioner",
                    "Patient:link",
                    "Patient:organization"
                ],
                "searchRevInclude": [
                    "Account:patient",
                    "Account:subject",

also see:另见:

https://www.hl7.org/fhir/search.html#include https://www.hl7.org/fhir/search.html#include

I think what your asking is resources types linked to a Patient.我认为您要问的是与患者相关的资源类型。 In this case you can do a http://base/fhir/Patient/[id]/$everything在这种情况下,您可以执行 http://base/fhir/Patient/[id]/$everything

https://hl7.org/fhir/operation-patient-everything.html https://hl7.org/fhir/operation-patient-everything.html

When you say "the list of resource types available for a patient from the FHIR server", I think what you mean is the resource types that can be searched by patient on the FHIR server.当您说“FHIR 服务器上患者可用的资源类型列表”时,我认为您的意思是患者可以在 FHIR 服务器上搜索的资源类型。

To build such a list, read the FHIR server's CapabilityStatement .要构建这样的列表,请阅读 FHIR 服务器的CapabilityStatement Iterate through the CapabilityStatement's resource array, checking each item's searchParam array for an element where name = 'patient' and type = 'reference'.遍历 CapabilityStatement 的resource数组,检查每个项目的searchParam数组中是否存在name = 'patient' 和type = 'reference' 的元素。 If you find it, add that item's type value (ie the resource type) to the list.如果您找到它,将该项目的type值(即资源类型)添加到列表中。

Thank you all for posting your answers.感谢大家发布您的答案。 I have achieved this by making a batch request like the below,我通过发出如下的批处理请求来实现这一点,

    Bundle bundle = new Bundle();

    bundle.setType(Bundle.BundleType.TRANSACTION);

    // Adding bundle entries to make the batch request

    // To fetch the resource count for each resource type

    for (String resource : resources) {

        String url = String.format(MyConstants.URLs.FETCH_SUMMARY_COUNT, 
        resource, patientId);

 bundle.addEntry().getRequest().setUrl(url).setMethod(Bundle.HTTPVerb.GET);

    }

    try {

        // Create a client

        IGenericClient client = fhirContext.newRestfulGenericClient(fhirServerUrl);

        BearerTokenAuthInterceptor bearerTokenAuthInterceptor = new BearerTokenAuthInterceptor(accessToken);

        client.registerInterceptor(bearerTokenAuthInterceptor);



        bundle = client.transaction().withBundle(bundle).execute();

        IFhirPath iFhirPath = fhirContext.newFhirPath();

        List<IntegerType> counts = iFhirPath.evaluate(bundle, MyConstants.FHIRPATH.SUMMARY_COUNT_FROM_BUNDLE,

                IntegerType.class);

        ResourceTypesResponse resourceTypesResponse = ResourceParser.getResourceTypes(counts, resources);

        if (resourceTypesResponse == null) {

            throw new PatientNotFoundException("Resource Not Found");

        }

        return resourceTypesResponse;

    } catch (Exception e) {

        if (e.getMessage().equalsIgnoreCase("HTTP 401 Unauthorized")) {

            return getResourceBundleForPatient(patientId, resources);

        } else {

            throw new PatientNotFoundException("Patient Id Not Found");

        }

    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在FHIR服务器中搜索特定的资源ID - Search a FHIR server for a specific resource id 在 spring 引导中接受 FHIR 资源“患者”作为 RequestBody - Accepting FHIR Resource 'Patient' as a RequestBody in spring boot 从命令行编译时,有没有办法在Java中获取类型的包名? 对于类型,我可以获得他们可用的方法列表吗? - Is there any way to get package names for types in Java while compiling from command line? And for types, can i get their available method list? fhir.executeBundle 替换资源 id...如何防止这种情况? - fhir.executeBundle replacing resource id…How to prevent this? 使用 SHA256 生成 FHIR 资源逻辑 ID - FHIR Resource logical id generation using SHA256 如何为Hapi Fhir服务器的观察资源提供者实现搜索操作? - How to implement Search operation for an Observation Resource Provider for Hapi Fhir server? 有没有办法从我的预定义列表中的属性具有值的 firebase 实时数据库中获取记录? - is there any way to fetch records from firebase realtime database whose attribute has a value in my predefined list? 从实体列表中获取@OneToMany的有效方法 - Efficient way to fetch @OneToMany from a list of entities 在资源服务器中获取用户信息 - Fetch user information in Resource Server 有什么办法可以转换这些不可转换的类型? - Is there any way to convert these inconvertible types?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM