source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Adapters/General/ConsumerPreferencesProfileGUI/web/update.jsp@ 507

Last change on this file since 507 was 507, checked in by George Lilly, 15 years ago

NHIN gateway and adaptor for use on linux with VistA EHR and RPMS

File size: 1.5 KB
Line 
1<%--
2 Document : update
3 Created on : Mar 16, 2009, 10:39:43 AM
4 Author : svalluripalli
5--%>
6
7<%@page contentType="text/html" pageEncoding="UTF-8"%>
8<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
9 "http://www.w3.org/TR/html4/loose.dtd">
10<%@ page import="java.util.*" %>
11<%@ page import="gov.hhs.fha.nhinc.mpilib.*" %>
12<%@ page import="org.w3c.dom.*" %>
13<%@ page import="gov.hhs.fha.nhinc.cpp.*" %>
14
15 <%
16 String orgId = "123";
17 int patCount = Integer.parseInt(session.getAttribute("patCount").toString());
18 Patients oldPats = new Patients();
19 Patients newPats = new Patients();
20 newPats.clear();
21 MiniMpi mpi = MiniMpi.GetMpiInstance();
22 oldPats = mpi.getPatients();
23
24 Patients pats = (Patients)session.getAttribute("pats");
25 for (int x = 0; x<pats.size();x++)
26 {
27 String value = request.getParameter( "chk_" +x ) + "";
28 boolean optIn =(value.equals("on"));
29 pats.get(x).setOptedIn(optIn);
30 if(oldPats.get(x).isOptedIn() != optIn)
31 {
32 newPats.add(pats.get(x));
33 }
34 }
35 if(!newPats.isEmpty())
36 {
37 CPPUtils.Save(newPats);
38 }
39 %>
40<html>
41 <head>
42 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
43 <title>JSP Page</title>
44 </head>
45 <body>
46 <h2> Updated <%= newPats.size() %> patients</h2>
47 </body>
48</html>
Note: See TracBrowser for help on using the repository browser.