ContosoService : Fetching Data from the HealthVault : Patients.xml file not getting updated

Mar 17, 2009 at 8:03 AM

Hi all ,

Firstly very thanks for this project that demonstrates the HealthVault Patient Connect and Master-Child Application working.
Problem is with updating of the Patients.xml file . i.e fetching information from the MS healthvault vis the windows service
Any Help in this regard will be highly appreciated


I am able to create an Identification code for a  patient. i.e When the User is directed to default page wherein he can add new patient , I select 'Add Patient' , it directs me to AddPatient.aspx which asks for patient name, identification question and answer. I  provide the detail and clicks on “Add and submit to Health Vault” . It adds the patient to Health vault and Xml files present in “\Contoso Health Single physician Practice\website\Data\Practice\Patients.xml”. Then I am directed to acknowledgement page wherein I can take the printout of the acknowledgement page containing identification Id.

Then I logs onto  “https://account.healthvault-ppe.com/patientwelcome.aspx” to enter the identification code for providing access . It asks me the identification code and then it asks me the identification question and answer.

I approves the access .

Problem is with updating of the Patients.xml file . i.e fetching information from the MS healthvault vis the windows service


Then i run the ContosoService so as to fetch the Patient 's demographic information from the MS HealthVault. and also to upload the information of the patient to the healthvault.

The service gets installed by 'Install ContosoService.bat'
It is shown in ther services.msc and i manually run the service .

The service run and it generates the files log file and Scheduler Last Run.txt .

The log file contains info 'Scheduler started at: 3/17/2009 1:19:03 PM'  i.e log of the schedular start time every 40sec.

The last run.txt contains 'last run time '

But the Patients.xml is not getting updated with the demographic information and neither
RegisteredWithHealthVault>false</RegisteredWithHealthVault>
<HV_Person_ID>00000000-0000-0000-0000-000000000000</HV_Person_ID>
 <HV_Record_ID>00000000-0000-0000-0000-000000000000</HV_Record_ID>

is getting updated


HELP NEEDED in this regards.

The HealthSchedular.exe.config file contains the correct path of the Patients.xml file.
Below are the contents of the HealthSchedular.exe.config file ::

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings>
  <!-- Timer settings -->
  <add key = "Days" value = "0"/>
  <add key = "Hours" value = "0"/>
  <add key = "Minutes" value = "0"/>
  <add key = "Seconds" value = "40"/>

  <!-- Log file settings -->
  <add key = "LogFile" value = "C:\Service Log.txt"/>  

  <!-- Log file settings (Last run of the scheduler) -->
  <add key = "LastRunLogFile" value="C:\Scheduler Last Run.txt"/>
  
  <!-- Application Id -->
  <add key = "ApplicationId" value="85dbe60d-e191-44f8-b387-59bc5269ae8a"/>
  <add key = "AppCertSubject" value="WildcatApp-1fbc292c-30be-4dc1-b870-606878e91d03"/>

  <!-- Patient's xml file path -->
  <add key = "PatientXmlFilePath" value="C:\MS PatientConnect\Contoso Health Single physician Practice\website\Data\Practice\Patients.xml"/>
    <add key="PracticeFolderPath" value="C:\MS PatientConnect\Contoso Health Single physician Practice\website\Data\Practice"/>
  <!-- Health service url -->
  <add key="HealthServiceUrl" value="https://platform.healthvault-ppe.com/platform/" />
 </appSettings>
</configuration>

Developer
Mar 17, 2009 at 12:08 PM

Hello Amit,

Scheduler matches the patient id and updates the patient details in the xml, can you provide the Service Log.txt and Patients.xml files to look in to the issue.

Mar 17, 2009 at 2:36 PM

Hi ,

Thanks for reverting to my query,  Please find below the files asked by you.


The contents of the Service Log.txt is

Scheduler started at: 3/17/2009 7:55:12 PM
 

Scheduler started at: 3/17/2009 7:55:54 PM
 

Scheduler started at: 3/17/2009 7:56:37 PM
 

Scheduler started at: 3/17/2009 7:57:30 PM
 

Scheduler started at: 3/17/2009 7:58:14 PM
 

Scheduler started at: 3/17/2009 7:58:57 PM
 

Scheduler started at: 3/17/2009 7:59:50 PM
 

Scheduler started at: 3/17/2009 8:00:34 PM
 



--------------------------------------------------------------------------------------------------------

Contents of the Patients.xml is


<?xml version="1.0" standalone="yes"?>
<Patients>
   <Patient>
    <id>2e7e7527-0429-4948-b4bd-e2aac40b5f4f</id>
    <MedicalRecordNumber>8183025d-ca91-410c-ad72-cafddf0863e3</MedicalRecordNumber>
    <LastName>4</LastName>
    <FirstName>TestPatient</FirstName>
    <MiddleName />
    <YearOfBirth>1983</YearOfBirth>
    <Gender>Male</Gender>
    <City>Jalandhar</City>
    <State>Punjab</State>
    <Country>IN</Country>
    <Active>true</Active>
    <RegisteredWithHealthVault>true</RegisteredWithHealthVault>
    <HV_Person_ID>8a854514-3b74-4983-ae4d-df8cae303f30</HV_Person_ID>
    <HV_Record_ID>3bf033d6-4239-431f-b072-3d5d3c9c4f32</HV_Record_ID>
  </Patient>
  <Patient>
    <id>f10d569e-062b-4199-b669-59e56a191741</id>
    <MedicalRecordNumber>d2544b96-3553-4b88-ad23-34b928def020</MedicalRecordNumber>
    <LastName>5</LastName>
    <FirstName>TestPatient</FirstName>
    <MiddleName />
    <Gender />
    <City />
    <State />
    <Country />
    <Active>true</Active>
    <RegisteredWithHealthVault>false</RegisteredWithHealthVault>
    <HV_Person_ID>00000000-0000-0000-0000-000000000000</HV_Person_ID>
    <HV_Record_ID>00000000-0000-0000-0000-000000000000</HV_Record_ID>
  </Patient>
  <Patient>
    <id>859987ce-5907-4ee9-b698-63865d35f77c</id>
    <MedicalRecordNumber>e2068a57-35b7-49c1-879b-ef921c5b5025</MedicalRecordNumber>
    <LastName>6</LastName>
    <FirstName>Patient</FirstName>
    <MiddleName />
    <Gender />
    <City />
    <State />
    <Country />
    <Active>true</Active>
    <RegisteredWithHealthVault>false</RegisteredWithHealthVault>
    <HV_Person_ID>00000000-0000-0000-0000-000000000000</HV_Person_ID>
    <HV_Record_ID>00000000-0000-0000-0000-000000000000</HV_Record_ID>
  </Patient>
</Patients>

---------------------------------------------------------------------------------------

AS you can see , I added 3 records 
TestPatient 4
TestPatient 5
Patient 6



In this , content of the TestPatient 4 are updated but the contents of the TestPatient 5 and Patient 6 are not updated.

The schedular runs every 40 seconds,..should not it update the Patients.xml after each 40 seconds or so.

I don't know how that Patient 4 got updated , The application is running and also the Webservice is running.

But the other two records are not getting updated.


Your help is highly appreciated

Regards
Amit

Developer
Mar 18, 2009 at 5:32 AM

Hello Amit,

I tried executing the contoso service with the patient xml provided by you with Scheduler Last Run.txt as blank (i.e. scheduler will fetch all patients starting from DateTime.MinValue) , and i was able to fetch all the patients detail listed in the xml.

I tried executing the contoso service with the patient xml provided by you with Scheduler Last Run.txt as 3/17/2009 1:19:03 PM as provided by you in this post (i.e. scheduler will fetch all patients valid since 3/17/2009 1:19:03 PM) , and i could fetch only Patient 6 there seems to be a time lag between the registration and fetching the patient information.

you can clear your Scheduler Last Run.txt or change the date time to 3/16/2009 1:19:03 PM and it should work.

Mar 18, 2009 at 6:34 AM
Hi ,

Thanks for your reply.

I changed the date time to 3/16/2009 1:19:03 PM in the Schedular LastRun.txt , and by doing so I was able to update my Patients.xml

Does it mean, that the Schedular fetch only those patient records that approved the access to the Contoso HealthService since the time in Schedular LastRun.txt.

Can you confirm my understanding ?

If this is the case , lets say schedular is fetching the records every minute ( or every 40 seconds) from the server , like in this case.

I adds a patient and generates its Identification code .
The patient gaves access to Contoso service , after 30 minutes or so ( i.e after schedular cyclic time of 40 seconds ) .

In this case schedular will not be able to fetch the records .

Can you clear my understanding.

Also , what you mean by ' there seems to be a time lag between the registration and fetching the patient information.' that you mentioned in your reply.



Regards
Amit

Developer
Mar 18, 2009 at 12:09 PM

Hi

When you visit the "https://account.healthvault-ppe.com/patientwelcome.aspx” and register patient to the provider (Application Id) at that point the patient is registered in HealthVault and can be fetched.

In your case if you register the patient after some time span (say 30 min) then also the scheduler will fetch the patient record as the register time span will be the time of providing access to the provider.

by time lag i mean that your service might have been executing and you provided the acess to patient, when the patient was registered the timer in scheduler elasped and it didn't get the record, when the second fetch cycle started the patient cannot be seen as the last run time exceeded the patient registration time

Mar 19, 2009 at 5:31 AM
Thanks for your support

I am clear with the working of the application

If i will have any further doubts I may seek your help

Regards
Amit
Jun 4, 2009 at 6:57 PM

Hello Amit,

I am trying to set the "Trey Research Online EMR Multi-physician Practice" application. I am able to log in, but when i click on Add patients and try to submit the data to healthvault, I am getting a keynote does not exist exception. I have added the Master certficate which comes with the download into my certificate store and have given the required access. The exception occurs at this line,

 

<font size="2" color="#2b91af"><font size="2" color="#2b91af">

OfflineWebApplicationConnection

</font></font><font size="2" color="#2b91af">

 

</font>

offlineConn = new OfflineWebApplicationConnection(applicationId, WebApplicationConfiguration.HealthServiceUrl, Guid.Empty);

in the HealthvaultConnectionManager.CreateConnection method. The application id is the client application id which it retrieves from the practices.xml.

Should we upload the Master certificate through the application manager? Or it is just enough if we import it into the certificate store?

What about the child application id's which are present in the practices.xml, how could they be recognized by the healthvault platform?

Please help me out on this.

Thanks

Coordinator
Jun 5, 2009 at 2:02 AM

The error you are seeing is a cert related error. Your observation is correct, you'd need to re-import the cert using AppliCationManager and provide access to ASP.NET user accout and IIS.

To answer your second question. the platform takes care of associating the children with the appropriate Master AppId based on the AppId in the request.

Thanks,

Vinil

Apr 2, 2013 at 2:25 PM
hi,
If a company wants to integrate HealthVault in their PHR should they have to make some kind of agrrement or contract with Microsoft for using services?
kindly guide me in this scenario.Thanx in advance.
Developer
Apr 2, 2013 at 2:55 PM

Yes,

You need to complete the Solution Provider Agreement with HV team, more details available at http://msdn.microsoft.com/en-us/healthvault/bb962148.aspx

Thanks

Sameer.