Click or drag to resize
PatientService

[This is preliminary documentation and is subject to change.]

The PatientService web service contains web methods concerned with managing the patients in a specific configuration

Patient Service
Patient Service
CreatePatient method

The CreatePatient method creates new patients in the specified configuration.

C#
public Patient CreatePatient(string config, Guid sessionGuid, Patient patient);
GetById method

Get patient by database id

C#
public Patient GetById(string config, Guid sessionGuid, int id);
GetByNationalId method

Get patient by national identifier.

C#
public Patient GetByNationalId(string config, Guid sessionGuid, string nationalId);
GetBySQL method

Get patient by custom SQL statement

C#
public PatientCollection GetBySQL(string config, Guid sessionGuid, string sqlQuery);
GetRecordTreeAsXML method

Get the record tree as xml for a given patient identified by database id

C#
public XmlDocument GetRecordTreeAsXML(string config, Guid sessionGuid, int patientId, string encodingName);
GetRecordTree method

Get the record tree as for a given patient identified by database id

C#
public RootRecordTreeNode GetRecordTree(string config, Guid sessionGuid, int patientId);
Using PatientService web service

In the following example we login and create a patient on a specific configuration

C#
// CreatePatient method example

string config = "GOP";                        // or "Projektdata" - name of configuration
string domain = "1351";                        // domain for the user we login with
string username = "Admin1351";                // username for the user we login with
string password = "secret";                    // password for the user we login with

//first we login with a user that can create other users
LoginService loginService = new LoginService();
LogOnInfo logOnInfo = loginService.LogInPlainPassword(config, domain, username, password, false);

if (logOnInfo.Status != LogOnStatus.Ok)
return; // could not log on

// then we create a patient object for the patient we wish to create
Patient patient = new Patient();
patient.FirstName = "Ole";                    // new patients firstname
patient.Username = "Olesen":                // new patients lastname
patient.CprNr = "1234561234";                // new patients National id
patient.Road = "Olesvej";                    // name of road in new patients home address
patient.HouseNum = "1";                        // housnumber in new patients home address

// and finally we create the new patient
PatientService patientService = new PatientService();
patientService.CreatePatient(logOnInfo.ConfigName, logOnInfo.SessionGuid,patient);