0

I'm creating patient records through apex REST api in Salesforce Health Cloud.Actually Patient records have Account lookup field.How can I convert newly created candidate patient record into Patient Account.

@RestResource(urlMapping='/Patientfulldetails/*')
global with sharing class GetPatientDetailsAPI {

    @HttpPost
    global static void createNewPatient(String sourcesystemid,String name, String givenname,String familyname) {

        HealthCloudGA__CandidatePatient__c newPatient = new HealthCloudGA__CandidatePatient__c();  
        newPatient.HealthCloudGA__SourceSystemId__c= sourcesystemid;
        newPatient.HealthCloudGA__Name__c= name;
        newPatient.HealthCloudGA__GivenName1__c= givenname;
        newPatient.HealthCloudGA__FamilyName1__c = familyname;
        insert newPatient;

        //How to convert "HealthCloudGA__CandidatePatient__c" record into Patient Account.Patient Account is a lookup realtion ship field.
    }
}

I'm trying this from last two days.I couldn't get an idea.Please anyone suggest some ideas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.