-
Notifications
You must be signed in to change notification settings - Fork 0
/
built.php
181 lines (148 loc) · 6.58 KB
/
built.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>We Built Your Privacy Notice</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/pure-min.css">
<link rel="stylesheet" href="css/hnpp.css">
<link rel="stylesheet" href="css/builder.css">
</head>
<body>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// PHP data loading from the main form.
$type = $_REQUEST['type'];
$orgname = $_REQUEST['orgname'];
$orgwebsite = $_REQUEST['orgwebsite'];
$orgadd1 = $_REQUEST['orgadd1'];
$orgadd2 = $_REQUEST['orgadd2'];
$orgcity = $_REQUEST['orgcity'];
$orgstate = $_REQUEST['orgstate'];
$orgzip = $_REQUEST['orgzip'];
$offname = $_REQUEST['offname'];
$offphone = $_REQUEST['offphone'];
$offemail = $_REQUEST['offemail'];
$datenotice = $_REQUEST['datenotice'];
$lmedrecord = $_REQUEST['lmedrecord'];
$lcorrectrecord = $_REQUEST['lcorrectrecord'];
$llimitshare = $_REQUEST['llimitshare'];
$lsharedwho = $_REQUEST['lsharedwho'];
$lpapercopy = $_REQUEST['lpapercopy'];
$lblue = $_REQUEST['lblue'];
$specialnotes = $_REQUEST['special-notes'];
$specialocha = $_REQUEST['special-ocha'];
$speciallaws = $_REQUEST['special-laws'];
// Beginning of file creation.
$toFile = "";
$toFile = file_get_contents("header-boiler.html");
$toFile .= file_get_contents("style-boiler.html");
$toFile .= "<title>".$orgname."</title>";
$toFile .= "</head><body>";
$toFile .= "<header>";
$toFile .= "<div id='mainaddress'><address>".$orgadd1.
"<br />";
if( $orgadd2 != "" ) {
$toFile .= $orgadd2."<br />";
}
$toFile .= $orgcity.", ".$orgstate." ".$orgzip.
"</address><br /><h4>Privacy Official</h4><span class='privoff'>".$offname.
"</span><br /><span class='offphone'>".$offphone.
"</span><br /><span class='offemail'><a href='mailto:".$offemail.
"?Subject=Regarding%20Digital%20Health%20Privacy%20Notice' target='_top'>".$offemail.
"</a></span></div>\n\n";
$toFile .= "<h1>".$orgname."</h1>\n";
$toFile .= "<a id='mainwebsite' href='".$orgwebsite."'>".$orgwebsite."</a>\n";
$toFile .= "<h4 id='datenot'>Effective date of notice: ".$datenotice."</h4>\n";
$toFile .= "<br style='clear:both;' />";
$toFile .= "</header>";
// Custom link creation.
$toFile .= '<div class="custom">';
$toFile .= '<h3>Quick Links</h3><ul id="thelinks">';
if( $lmedrecord != "" ) {
$toFile .= '<li>Request a copy of your medical record<br />
<a href="'.$lmedrecord.'">'.$lmedrecord.'</a></li>';
}
if( $lcorrectrecord != "" ) {
$toFile .= '<li>Correct or request a change to your medical record<br />
<a href="'.$lcorrectrecord.'">'.$lcorrectrecord.'</a></li>';
}
if( $llimitshare != "" ) {
$toFile .= '<li>Request that this organization limit who they share your information with<br />
<a href="'.$llimitshare.'">'.$llimitshare.'</a></li>';
}
if( $lsharedwho != "" ) {
$toFile .= '<li>Request a list of parties that your information has been shared with by this organization<br />
<a href="'.$lsharedwho.'">'.$lsharedwho.'</a></li>';
}
if( $lpapercopy != "" ) {
$toFile .= '<li>Request a paper copy of this notice<br />
<a href="'.$lpapercopy.'">'.$lpapercopy.'</a></li>';
}
if( $lblue != "" ) {
$toFile .= '<li>Gain access to your information through participation in Blue Button<br />
<a href="'.$lblue.'">'.$lblue.'</a><br /><span class="small">Blue Button is a symbol for patient access to their personal health information in a usable and safe digital format. <a href="http://www.hhs.gov/digitalstrategy/open-data/introducing-blue-button-plus.html">Learn more about Blue Button.</a></span></li>';
}
// Handle organizations that provide no links.
if( $lmedrecord.$lcorrectrecord.$llimitshare.$lsharedwho.$lpapercopy.$lblue == "" ) {
$toFile .= '<li>'.$orgname.' has not provided any links to help you access or correct your information. To find out more contact them directly.</li>';
}
$toFile .= '</ul>';
$toFile .= '</div>';
// Custom notes.
$toFile .= '<div class="custom">';
$toFile .= '<h3>Notes about our organization</h3>';
if( $speciallaws != "" ) {
$toFile .= '<h4>State or other laws that require greater limits</h4>
<p>'.$speciallaws.'</p>';
}
if( $specialocha != "" ) {
$toFile .= '<h4>Organized Health Care Arrangement joint notice</h4>
<p>'.$specialocha.'</p>';
}
if( $specialnotes != "" ) {
$toFile .= '<h4>Special notes on our practices</h4>
<p>'.$specialnotes.'</p>';
}
// Handle organizations that provide no links.
if( $speciallaws.$specialocha.$specialnotes == "" ) {
$toFile .= '<p>'.$orgname.' has not provided any custom information to give you details on the specifics of their own practices.</p>';
}
$toFile .= '<br /></div>';
$toFile .= '<div class="boilerplate">';
$toFile .= '<p id="theboilerplate">Everything below this point is standard text offered by the Department of Health and Human Services. The below rules, rights, and definitions apply to all health plan and health care providers.</p>';
$toFile .= '</div>';
$toFile .= '<div class="boilerplate">';
if( $type == "hplan" ) {
$toFile .= file_get_contents("plan-boiler.html");
} else {
$toFile .= file_get_contents("provider-boiler.html");
}
$toFile .= '</div>';
$toFile .= '</body></html>';
$orgnospace = preg_replace('/[^a-z0-9]+/i', '_', $orgname);
$fileIS = $orgnospace."".rand(10000,99999).".html";
file_put_contents( "x/".$fileIS, $toFile );
//echo $toFile;
}
?>
<div class="builder">
<p style="padding-top:10px;"><a href="index.php">Return to the home page</a></p>
</div>
<div class="stretchcolor" style="padding: 5px 0 30px;;">
<div class="builder">
<h2 style="text-align:center; font-size:44px;">Your notice has been built!</h2>
</div>
</div>
<header style="text-align:center;font-size:32px;">
<br /><br />You can view your notice now, live at:<br /><br />
<?php
echo "<a style='font-size:28px;' class='pure-button pure-button-primary' href='x/".$fileIS."'>exitlab.net/healthNPP/x/".$fileIS."</a>";
?>
<p style="text-align:center;font-size:24px;"><br />We are happy to host this file for you permanently.</p>
<p style="text-align:center;font-size:24px;">Or you can download this file and host it on your own website, all the information and styles it needs are self-contained in a single file.</p>
</header>
</body>
</html>