当前位置: 首页>>代码示例>>Java>>正文


Java MethodOutcome.getCreated方法代码示例

本文整理汇总了Java中ca.uhn.fhir.rest.api.MethodOutcome.getCreated方法的典型用法代码示例。如果您正苦于以下问题:Java MethodOutcome.getCreated方法的具体用法?Java MethodOutcome.getCreated怎么用?Java MethodOutcome.getCreated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca.uhn.fhir.rest.api.MethodOutcome的用法示例。


在下文中一共展示了MethodOutcome.getCreated方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createServerResources

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
private static void createServerResources(IGenericClient client, Iterable<Object> resources, String dataType){
	for(Object obj : resources){
		IBaseResource resource = (IBaseResource) obj;
	
		//attempt to update existing
		MethodOutcome outcome = client.update()
				.resource(resource)
				.conditional()
				.where(new TokenClientParam("identifier").exactly()
					.systemAndCode("http://mcm.usciitg-prep.org", resource.getIdElement().getIdPart()))
				.execute();

		// This will return Boolean.TRUE if the server responded with an HTTP 201 created,
		// otherwise it will return null.
		Boolean created = outcome.getCreated();
		if(created == null){
			//try creating new
			outcome = client.create()
					.resource(resource)
					.conditional()
					.where(new TokenClientParam("identifier").exactly()
							.systemAndCode("http://mcm.usciitg-prep.org", resource.getIdElement().getIdPart()))
					.execute();	
			created = outcome.getCreated();
		}
					
		IIdType id = (IIdType) outcome.getId();
		System.out.println(dataType + ":" + resource.getIdElement().getValue() + " created:" + created + " ID:" + id.getValue());
	}
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:31,代码来源:UsciitgFhirDataProviderHL7IT.java

示例2: createPractitioner

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createPractitioner(FhirContext oContext,List<Practitioner> listOfPractitioners,String serverUrl) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";
    try
    {
        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfPractitioners.size();
        for(Practitioner oPractitioner: listOfPractitioners)
        {
            //oPractitioner.getPractitionerRole().get(0).getManagingOrganization().se
            respOutcome=client.update()
                    .resource(oPractitioner)
                    .prettyPrint()
                    .encodedJson()
                    .execute();
            if(respOutcome.getCreated())
            {
                nbreResourceCreated++;
            }
        }
        int succes=nbreResourceCreated;
        int failed=total-succes;
        stringTransactionResult="total:"+total+"," +
                "succes:"+succes+"," +
                "failed:"+failed+"}";

    }
    catch (Exception exc)
    {
        throw new Exception(exc.getMessage());
    }
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:38,代码来源:FhirResourceValidator.java

示例3: createOrganization

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createOrganization(FhirContext oContext,List<Organization> listOfOrganization,String serverUrl) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";
    try
    {
        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfOrganization.size();
        for(Organization oOrganization: listOfOrganization)
        {
            respOutcome=client.update()
                    .resource(oOrganization)
                    .prettyPrint()
                    .encodedJson()
                    .execute();
            if(respOutcome.getCreated())
            {
                nbreResourceCreated++;
            }
        }
        int success=nbreResourceCreated;
        int failed=total-success;
        stringTransactionResult="total:"+total+"," +
                "succes:"+success+"," +
                "failed:"+failed+"}";

    }
    catch (Exception exc)
    {
        throw new Exception(exc.getMessage());
    }
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:37,代码来源:FhirResourceValidator.java

示例4: createBundle

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createBundle(FhirContext oContext,List<Bundle> listOfBundles,String serverUrl) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";
    try
    {
        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfBundles.size();
        for(Bundle oBundle: listOfBundles )
        {
            respOutcome=client.update()
                    .resource(oBundle)
                    .prettyPrint()
                    .encodedJson()
                    .execute();
            if(respOutcome.getCreated())
            {
                nbreResourceCreated++;
            }
        }
        int success=nbreResourceCreated;
        int failed=total-success;
        stringTransactionResult="total:"+total+"," +
                "succes:"+success+"," +
                "failed:"+failed+"}";

    }
    catch (Exception exc)
    {
        throw new Exception(exc.getMessage());
    }
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:37,代码来源:FhirResourceValidator.java

示例5: createDiagnosticOrder

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createDiagnosticOrder(FhirContext oContext,List<DiagnosticOrder> listOfDiagnosticOrder,String serverUrl
, String logFileName) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";
        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfDiagnosticOrder.size();
        for(DiagnosticOrder oDiagnosticOrder: listOfDiagnosticOrder)
        {
            try
            {
                respOutcome=client.update()
                        .resource(oDiagnosticOrder)
                        .prettyPrint()
                        .encodedJson()
                        .execute();
                if(respOutcome.getCreated())
                {
                    nbreResourceCreated++;
                }
            }
            catch (Exception exc)
            {
                FhirMediatorUtilities.writeInLogFile(logFileName,
                        oDiagnosticOrder.toString()+" Creation resource operation failed! "+exc.getMessage(),"Error");

                continue;
            }

        }
        int success=nbreResourceCreated;
        int failed=total-success;
        stringTransactionResult="total:"+total+"," +
                "succes:"+success+"," +
                "failed:"+failed+"}";
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:41,代码来源:FhirResourceValidator.java

示例6: createObservation

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createObservation(FhirContext oContext,List<Observation> listOfObservation,String serverUrl
, String logFileName) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";
        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfObservation.size();
        for(Observation oObservation: listOfObservation)
        {
            try
            {
                respOutcome=client.update()
                        .resource(oObservation)
                        .prettyPrint()
                        .encodedJson()
                        .execute();
                if(respOutcome.getCreated())
                {
                    nbreResourceCreated++;
                }
            }
            catch (Exception exc)
            {
                FhirMediatorUtilities.writeInLogFile(logFileName,
                        oObservation.toString()+" Creation resource operation failed! "+exc.getMessage(),"Error");

                continue;
            }
        }
        int success=nbreResourceCreated;
        int failed=total-success;
        stringTransactionResult="total:"+total+"," +
                "succes:"+success+"," +
                "failed:"+failed+"}";
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:40,代码来源:FhirResourceValidator.java

示例7: createDiagnosticReport

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createDiagnosticReport(FhirContext oContext,List<DiagnosticReport> listOfDiagnosticReport,String serverUrl
,String logFileName) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";
        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfDiagnosticReport.size();
        for(DiagnosticReport oDiagnosticReport: listOfDiagnosticReport)
        {
            try
            {
                respOutcome=client.update()
                        .resource(oDiagnosticReport)
                        .prettyPrint()
                        .encodedJson()
                        .execute();
                if(respOutcome.getCreated())
                {
                    nbreResourceCreated++;
                }
            }
            catch (Exception exc)
            {
                FhirMediatorUtilities.writeInLogFile(logFileName,
                        oDiagnosticReport.toString()+" Creation resource operation failed! "+exc.getMessage(),"Error");

                continue;
            }
        }
        int success=nbreResourceCreated;
        int failed=total-success;
        stringTransactionResult="total:"+total+"," +
                "succes:"+success+"," +
                "failed:"+failed+"}";
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:40,代码来源:FhirResourceValidator.java

示例8: extractResponseStaticsFromBundleTransactionRespons

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String extractResponseStaticsFromBundleTransactionRespons(MethodOutcome bundleResponse, int operationType) throws Exception
{
    int succes=0;
    int failed=0;
    String res="";

    int total=1;
    if(operationType==1)
    {
        if(bundleResponse.getCreated())
        {
            succes++;
        }
        else
        {
            failed++;
        }
    }
    else
    {
        if(bundleResponse.getCreated())
        {
            succes++;
        }
        else
        {
            failed++;
        }
    }
    if(operationType==1)
    {
        res ="{id:insert operation,";
    }
    else if (operationType==2)
    {
        res ="{id:update operation,";
    }
    res+="total:"+total+"," +
            "succes:"+succes+"," +
            "failed:"+failed+"}";
    return res;

}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:44,代码来源:FhirResourceValidator.java

示例9: createPatient

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createPatient(FhirContext oContext,List<Patient> listOfPatient,String serverUrl
,String logFileName) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";

        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfPatient.size();
        for(Patient oPatient: listOfPatient)
        {
            try {
                //specimenToTrace = oSpecimen;
                respOutcome = client.update()
                        .resource(oPatient)
                        .prettyPrint()
                        .encodedJson()
                        .execute();
                if(respOutcome.getCreated())
                {
                    nbreResourceCreated++;
                }
            }
            catch (Exception exc)
            {
                FhirMediatorUtilities.writeInLogFile(logFileName,
                        oPatient.toString()+" Creation resource operation failed! "+exc.getMessage(),"Error");
                continue;

                //throw new Exception(exc.getMessage());
            }
        }
        int success=nbreResourceCreated;
        int failed=total-success;
        stringTransactionResult="total:"+total+"," +
                "succes:"+success+"," +
                "failed:"+failed+"}";
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:42,代码来源:FhirResourceValidator.java

示例10: createListResource

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createListResource(FhirContext oContext,List<ListResource> listOfListResource,String serverUrl
        ,String logFileName) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";

    IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

    int compter=0;
    int nbreResourceCreated=0;
    int total=listOfListResource.size();

    for(ListResource oListResource: listOfListResource)
    {
        try {
            //specimenToTrace = oSpecimen;
            respOutcome = client.update()
                    .resource(oListResource)
                    .prettyPrint()
                    .encodedJson()
                    .execute();
            if(respOutcome.getCreated())
            {
                nbreResourceCreated++;
            }
        }
        catch (Exception exc)
        {
            FhirMediatorUtilities.writeInLogFile(logFileName,
                    oListResource.toString()+" Creation resource operation failed! "+exc.getMessage(),"Error");
            continue;

            //throw new Exception(exc.getMessage());
        }
    }
    int success=nbreResourceCreated;
    int failed=total-success;
    stringTransactionResult="total:"+total+"," +
            "succes:"+success+"," +
            "failed:"+failed+"}";
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:43,代码来源:FhirResourceValidator.java

示例11: createBasic

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createBasic(FhirContext oContext,List<Basic> listOfBasic,String serverUrl
        ,String logFileName) throws Exception
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";

    IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

    int compter=0;
    int nbreResourceCreated=0;
    int total=listOfBasic.size();

    for(Basic oBasic: listOfBasic)
    {
        try {
            //specimenToTrace = oSpecimen;
            respOutcome = client.update()
                    .resource(oBasic)
                    .prettyPrint()
                    .encodedJson()
                    .execute();
            if(respOutcome.getCreated())
            {
                nbreResourceCreated++;
            }
        }
        catch (Exception exc)
        {
            FhirMediatorUtilities.writeInLogFile(logFileName,
                    oBasic.toString()+" Creation resource operation failed! "+exc.getMessage(),"Error");
            continue;

            //throw new Exception(exc.getMessage());
        }
    }
    int success=nbreResourceCreated;
    int failed=total-success;
    stringTransactionResult="total:"+total+"," +
            "succes:"+success+"," +
            "failed:"+failed+"}";
    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:43,代码来源:FhirResourceValidator.java

示例12: createSpecimen

import ca.uhn.fhir.rest.api.MethodOutcome; //导入方法依赖的package包/类
public static String createSpecimen(FhirContext oContext,List<Specimen> listOfSpecimen,String serverUrl,
                                    String logFileName)
{
    MethodOutcome respOutcome=null;
    String stringTransactionResult="{TransactionResultStatus:no}";
    Specimen specimenToTrace=null;

        IGenericClient client=oContext.newRestfulGenericClient(serverUrl);

        int compter=0;
        int nbreResourceCreated=0;
        int total=listOfSpecimen.size();
        for(Specimen oSpecimen: listOfSpecimen)
        {
            try {
                //specimenToTrace = oSpecimen;
                respOutcome = client.update()
                        .resource(oSpecimen)
                        .prettyPrint()
                        .encodedJson()
                        .execute();
                if(respOutcome.getCreated())
                {
                    nbreResourceCreated++;
                }
            }
            catch (Exception exc)
            {
                FhirMediatorUtilities.writeInLogFile(logFileName,
                        oSpecimen.toString()+" Creation resource operation failed! "+exc.getMessage(),"Error");
                continue;

                //throw new Exception(exc.getMessage());
            }

        }
        int success=nbreResourceCreated;
        int failed=total-success;
        stringTransactionResult="total:"+total+"," +
                "succes:"+success+"," +
                "failed:"+failed+"}";

    return  stringTransactionResult;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:45,代码来源:FhirResourceValidator.java


注:本文中的ca.uhn.fhir.rest.api.MethodOutcome.getCreated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。