<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://129.151.190.5/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Khoppenworth</id>
	<title>OpenRIMS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://129.151.190.5/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Khoppenworth"/>
	<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php/Special:Contributions/Khoppenworth"/>
	<updated>2026-04-23T23:50:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_3&amp;diff=194</id>
		<title>OpenRIMS-RPM - Workflow Configuration Part 3</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_3&amp;diff=194"/>
		<updated>2025-01-18T21:54:38Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Resources Configuration ==&lt;br /&gt;
List of practical EL Expressions for document templates:&lt;br /&gt;
&lt;br /&gt;
# Todays date: ${/@today}&lt;br /&gt;
# Current User: ${/@author}&lt;br /&gt;
&lt;br /&gt;
== Reference Table for EL Expression ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Data type'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|'''Convertor'''&lt;br /&gt;
|'''Returns'''&lt;br /&gt;
|-&lt;br /&gt;
|strings&lt;br /&gt;
|Plain string&lt;br /&gt;
|@literal&lt;br /&gt;
|Plain string&lt;br /&gt;
|-&lt;br /&gt;
|literals&lt;br /&gt;
|Multi language string&lt;br /&gt;
|@literal&lt;br /&gt;
|Plain string on the current language&lt;br /&gt;
|-&lt;br /&gt;
|numbers&lt;br /&gt;
|Long integer&lt;br /&gt;
|@number&lt;br /&gt;
|Long integer number, Arabic&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@numberBS&lt;br /&gt;
|Long integer number, Nepali&lt;br /&gt;
|-&lt;br /&gt;
|dates&lt;br /&gt;
|Gregorian calendar date&lt;br /&gt;
|@date&lt;br /&gt;
|Medium formatted date in the current  culture&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@dateBS&lt;br /&gt;
|Nepal date, converted from Gregorian.  Arabic numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@dateBS1&lt;br /&gt;
|Nepal date, converted from Gregorian.  Nepali numbers&lt;br /&gt;
|-&lt;br /&gt;
|addresses&lt;br /&gt;
|administrative-territorial unit&lt;br /&gt;
|@level1&lt;br /&gt;
|The main unit, like republic, province.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@level2-@level5&lt;br /&gt;
|The lowers units, like district,  community, neighborhood.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@gis&lt;br /&gt;
|Geo-spatial data&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@choice&lt;br /&gt;
|All units in one string, example “East  Carroll Parish, Lake Providence, Louisiana”&lt;br /&gt;
|-&lt;br /&gt;
|dictionaries&lt;br /&gt;
|Single or multi choice dictionary&lt;br /&gt;
|@level1&lt;br /&gt;
|First level choice&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@level2-&lt;br /&gt;
&lt;br /&gt;
@level5&lt;br /&gt;
|Next levels&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@choice&lt;br /&gt;
|All choices in a single line, example  “private, hospital”&lt;br /&gt;
|-&lt;br /&gt;
|registers&lt;br /&gt;
|Filing system registers to assign  document numbers, registration and expiry dates&lt;br /&gt;
|@literal&lt;br /&gt;
|Register number&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@registered&lt;br /&gt;
|Register date Gregorian, medium format&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@registeredBS&lt;br /&gt;
|Register date Nepali, Arabic numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@registeredBS1&lt;br /&gt;
|Register date Nepali, Nepali numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@expired&lt;br /&gt;
|Expire registration, Gregorian&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@expiredBS&lt;br /&gt;
|Expire registration, Nepali, Arabic  numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@expiredBS1&lt;br /&gt;
|Expire registration, Nepali, Nepali  numbers&lt;br /&gt;
|-&lt;br /&gt;
|Age&lt;br /&gt;
|Full years from the current date&lt;br /&gt;
|@years&lt;br /&gt;
|Years using Gregorian calendar, Arabic  numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@yearsBS&lt;br /&gt;
|Years using Gregorian calendar, Nepali  numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@yearBS1&lt;br /&gt;
|Years using Nepali calendar, Nepali  numbers&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_3&amp;diff=193</id>
		<title>OpenRIMS-RPM - Workflow Configuration Part 3</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_3&amp;diff=193"/>
		<updated>2025-01-18T20:10:51Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resources Configuration&lt;br /&gt;
&lt;br /&gt;
Reference Table for EL Expression&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Data type'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|'''Convertor'''&lt;br /&gt;
|'''Returns'''&lt;br /&gt;
|-&lt;br /&gt;
|strings&lt;br /&gt;
|Plain string&lt;br /&gt;
|@literal&lt;br /&gt;
|Plain string&lt;br /&gt;
|-&lt;br /&gt;
|literals&lt;br /&gt;
|Multi language string&lt;br /&gt;
|@literal&lt;br /&gt;
|Plain string on the current language&lt;br /&gt;
|-&lt;br /&gt;
|numbers&lt;br /&gt;
|Long integer&lt;br /&gt;
|@number&lt;br /&gt;
|Long integer number, Arabic&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@numberBS&lt;br /&gt;
|Long integer number, Nepali&lt;br /&gt;
|-&lt;br /&gt;
|dates&lt;br /&gt;
|Gregorian calendar date&lt;br /&gt;
|@date&lt;br /&gt;
|Medium formatted date in the current  culture&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@dateBS&lt;br /&gt;
|Nepal date, converted from Gregorian.  Arabic numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@dateBS1&lt;br /&gt;
|Nepal date, converted from Gregorian.  Nepali numbers&lt;br /&gt;
|-&lt;br /&gt;
|addresses&lt;br /&gt;
|administrative-territorial unit&lt;br /&gt;
|@level1&lt;br /&gt;
|The main unit, like republic, province.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@level2-@level5&lt;br /&gt;
|The lowers units, like district,  community, neighborhood.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@gis&lt;br /&gt;
|Geo-spatial data&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@choice&lt;br /&gt;
|All units in one string, example “East  Carroll Parish, Lake Providence, Louisiana”&lt;br /&gt;
|-&lt;br /&gt;
|dictionaries&lt;br /&gt;
|Single or multi choice dictionary&lt;br /&gt;
|@level1&lt;br /&gt;
|First level choice&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@level2-&lt;br /&gt;
&lt;br /&gt;
@level5&lt;br /&gt;
|Next levels&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@choice&lt;br /&gt;
|All choices in a single line, example  “private, hospital”&lt;br /&gt;
|-&lt;br /&gt;
|registers&lt;br /&gt;
|Filing system registers to assign  document numbers, registration and expiry dates&lt;br /&gt;
|@literal&lt;br /&gt;
|Register number&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@registered&lt;br /&gt;
|Register date Gregorian, medium format&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@registeredBS&lt;br /&gt;
|Register date Nepali, Arabic numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@registeredBS1&lt;br /&gt;
|Register date Nepali, Nepali numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@expired&lt;br /&gt;
|Expire registration, Gregorian&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@expiredBS&lt;br /&gt;
|Expire registration, Nepali, Arabic  numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@expiredBS1&lt;br /&gt;
|Expire registration, Nepali, Nepali  numbers&lt;br /&gt;
|-&lt;br /&gt;
|Age&lt;br /&gt;
|Full years from the current date&lt;br /&gt;
|@years&lt;br /&gt;
|Years using Gregorian calendar, Arabic  numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@yearsBS&lt;br /&gt;
|Years using Gregorian calendar, Nepali  numbers&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|@yearBS1&lt;br /&gt;
|Years using Nepali calendar, Nepali  numbers&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_1&amp;diff=192</id>
		<title>OpenRIMS-RPM - Workflow Configuration Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_1&amp;diff=192"/>
		<updated>2025-01-18T20:08:41Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction to Automation =&lt;br /&gt;
This guide intends to OpenRIMS-RP Supervisors and contains reference data necessary to the creation of on-screen forms.&lt;br /&gt;
&lt;br /&gt;
The OpenRIMS-RP application and workflow data forms are configurable by the Supervisor. Any given data form consists of components. Each component provides an atomic functionality, i.e., data input/display field, choices from the pre-defined set of choices, file upload, file download, etc.&lt;br /&gt;
&lt;br /&gt;
Here is an Automation Checklist to ensure all factors are considered and included when setting up a workflow:&lt;br /&gt;
&lt;br /&gt;
=== Process Elements ===&lt;br /&gt;
1.      List all actors&lt;br /&gt;
&lt;br /&gt;
2.      List all activities&lt;br /&gt;
&lt;br /&gt;
3.      Select actors that will use OpenRIMS&lt;br /&gt;
&lt;br /&gt;
4.      Select activities that will be automated using OpenRIMS:&lt;br /&gt;
&lt;br /&gt;
4.1.   Performed by the actor that will use OpenRIMS&lt;br /&gt;
&lt;br /&gt;
4.2.   The name, outcome, and checklist of the activity can be formulated&lt;br /&gt;
&lt;br /&gt;
4.3.   This activity collects information&lt;br /&gt;
&lt;br /&gt;
5.      Decide office registers&lt;br /&gt;
&lt;br /&gt;
6.      Decide follow-up workflow (renewal, revision, etc.)&lt;br /&gt;
&lt;br /&gt;
7.      Decide the need for an electronic manual for the application and activities.&lt;br /&gt;
&lt;br /&gt;
=== Information/Data Elements ===&lt;br /&gt;
1.      Decide the preferred label for the application&lt;br /&gt;
&lt;br /&gt;
2.      Decide what information should be reported.&lt;br /&gt;
&lt;br /&gt;
3.      Decide on information placed in input fields and attached files&lt;br /&gt;
&lt;br /&gt;
4.      Decide OpenRIMS electronic form components to represent input fields (literals, dictionaries, registers, links, persons, etc.)&lt;br /&gt;
&lt;br /&gt;
5.      Decide document templates using OpenRIMS resources.&lt;br /&gt;
&lt;br /&gt;
6.      Decide data validation rules for each electronic form component&lt;br /&gt;
&lt;br /&gt;
Decide application form layout – pages, layout for each page&lt;br /&gt;
&lt;br /&gt;
To place any data component to an on-screen form the Supervisor should:&lt;br /&gt;
&lt;br /&gt;
·      Define a place on the form&lt;br /&gt;
&lt;br /&gt;
·      Provide component-specific parameters &lt;br /&gt;
&lt;br /&gt;
= Form layout =&lt;br /&gt;
             The basic configuration layout of an electronic form is in two columns. Depending on the room on the screen a form may be represented in two or one columns. In the case of the one-column representation, the second column will be placed under the first one.&lt;br /&gt;
&lt;br /&gt;
             The numbering of rows and columns starts from zero.&lt;br /&gt;
&lt;br /&gt;
Figure 1. The two columns layout&lt;br /&gt;
&lt;br /&gt;
The heigh of components may be very different. Thus, placing one component to a cell (row, col) is almost unusable &lt;br /&gt;
&lt;br /&gt;
Figure 2. The only cell is not enough&lt;br /&gt;
&lt;br /&gt;
             To avoid this, the OpenRIMS-RP provides the third coordinate – an order inside the cell. The order starts from zero and allows place many components in a cell.&lt;br /&gt;
&lt;br /&gt;
Figure 3. Cell and order inside a cell are acceptable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Electronic form =&lt;br /&gt;
&lt;br /&gt;
== Where to find it? ==&lt;br /&gt;
             The definitions of all electronic forms are in the feature Administrate-Configuration-Data Configurator.&lt;br /&gt;
&lt;br /&gt;
Figure 4. Electronic form configuration feature&lt;br /&gt;
&lt;br /&gt;
1.      Search for electronic form definition in the list below&lt;br /&gt;
&lt;br /&gt;
2.      List of all electronic form definitions&lt;br /&gt;
&lt;br /&gt;
3.      The definition of a selected electronic form (see above Figure 3)&lt;br /&gt;
&lt;br /&gt;
== Configuration data form ==&lt;br /&gt;
             The data form configuration consists of general data and layout configuration. In own turn, the layout configuration consists of variables.&lt;br /&gt;
&lt;br /&gt;
1.      Select to access the layout configuration&lt;br /&gt;
&lt;br /&gt;
2.      Click to edit general data&lt;br /&gt;
&lt;br /&gt;
3.      Add new form&lt;br /&gt;
&lt;br /&gt;
The general data consists of URL and description. URL is a unique identifier of the form; the description is a description of the whole form.&lt;br /&gt;
&lt;br /&gt;
Figure 5. General form data&lt;br /&gt;
&lt;br /&gt;
1.      Click to edit URL&lt;br /&gt;
&lt;br /&gt;
2.      The description of data&lt;br /&gt;
&lt;br /&gt;
3.      Press to save the general data&lt;br /&gt;
&lt;br /&gt;
4.      Press to remove the general data&lt;br /&gt;
&lt;br /&gt;
5.      Press to do nothing&lt;br /&gt;
&lt;br /&gt;
6.      Press to copy the general data and the layout configuration&lt;br /&gt;
&lt;br /&gt;
== Component configuration form ==&lt;br /&gt;
Figure 6. Layout form data&lt;br /&gt;
&lt;br /&gt;
1.      Click to edit a component definition (variable)&lt;br /&gt;
&lt;br /&gt;
2.      Add New component definition&lt;br /&gt;
&lt;br /&gt;
3.      Preview the electronic form&lt;br /&gt;
&lt;br /&gt;
== Component definition ==&lt;br /&gt;
1.      Click to edit the name of the component&lt;br /&gt;
&lt;br /&gt;
2.      The experimental feature will be described later&lt;br /&gt;
&lt;br /&gt;
3.      The help texts&lt;br /&gt;
&lt;br /&gt;
4.      Select a type of component, e.g.,  text field, file uploader.&lt;br /&gt;
&lt;br /&gt;
5.      Validation parameters. The particular meaning for a particular component&lt;br /&gt;
&lt;br /&gt;
6.      Screen position – row, col, order inside a cell (see Figure 3)&lt;br /&gt;
&lt;br /&gt;
7.      Additional configuration data for particular components&lt;br /&gt;
&lt;br /&gt;
= The components configuration reference =&lt;br /&gt;
&lt;br /&gt;
== headings ==&lt;br /&gt;
             Headers or links to external resources&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|Link to external resource&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;https://google.com&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== strings ==&lt;br /&gt;
             Text input field&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|min length in characters&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|max length in characters&lt;br /&gt;
|1024&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|value is required&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|the value should be unique&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|Java Regular expression pattern[1]&lt;br /&gt;
|[a-zA-Z]{3}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== literals ==&lt;br /&gt;
             See “strings” above&lt;br /&gt;
&lt;br /&gt;
== dates ==&lt;br /&gt;
             Date input control&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|months from the current date&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-3&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|months after the current date&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|value is required&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== numbers ==&lt;br /&gt;
             Number input field&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|min value&lt;br /&gt;
|0&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|max value&lt;br /&gt;
|1000000&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|value is required&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== logical ==&lt;br /&gt;
             Yes/No/NA logical field&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== dictionaries ==&lt;br /&gt;
             Allows selection from the pre-defined choices. For example&lt;br /&gt;
&lt;br /&gt;
Figure 7. The dictionary&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|at least one choice is required&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|url of the dictionary&lt;br /&gt;
|dictionary.guest.deregistration&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== addresses ==&lt;br /&gt;
             Address dictionary with the possibility to select geographical coordinates&lt;br /&gt;
&lt;br /&gt;
Figure 8. The address control&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|selection and coordinates are required&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|where to store and find&lt;br /&gt;
|nepal.address&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== documents ==&lt;br /&gt;
             Upload documents&lt;br /&gt;
&lt;br /&gt;
Figure 9. The file uploader component&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|wide of the image[2] in pixels&lt;br /&gt;
|300&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|height of the image in pixels&lt;br /&gt;
|300&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|at least one file should be uploaded&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|where to store and find&lt;br /&gt;
|pharmacy.documents&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|dictionary with the list of file to uplaod  descriptions&lt;br /&gt;
|dictionary.pharmacy.site.photos&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|file types allowed[3]&lt;br /&gt;
|.jpg,.png,.tiff&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== resources ==&lt;br /&gt;
             Download documents, pictures, and templates.&lt;br /&gt;
&lt;br /&gt;
Figure 10. The file resource component&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|Where are the files stored?&lt;br /&gt;
|pharmacy.new.invoices&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|value is read-only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== things ==&lt;br /&gt;
             Sub-forms or forms that placed at the right of the main form&lt;br /&gt;
&lt;br /&gt;
Figure 11. The main form and sub-forms&lt;br /&gt;
&lt;br /&gt;
1.      The main form. This form must contain a literal with the name prefLabel.&lt;br /&gt;
&lt;br /&gt;
2.      Additional forms that should be included using the “thing” class&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|URL of an electronic form configuration. This form  should not contain “things”, however may contain any other component&lt;br /&gt;
|retail.pharmacy.classifiers&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== persons ==&lt;br /&gt;
             Allows adding detailed records to the main data. Examples are pharmacy owners to a pharmacy or warehouses to the wholesaler.&lt;br /&gt;
&lt;br /&gt;
Figure 12. The &amp;quot;persons&amp;quot; component - detail records&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|at least one detail record is required&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|Where to store detail records&lt;br /&gt;
|site.owners.persons&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|The configuration of the detail record electronic  form. This configuration can contain subforms, i.e. “things”&lt;br /&gt;
|site.owner.person&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== schedulers ==&lt;br /&gt;
             Allows to run another follow-up application after the application will be approved. Examples are “scheduled renewal payment”, “scheduled inspection”, etc.&lt;br /&gt;
&lt;br /&gt;
Figure 13. The scheduler component&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|Offset in months from the current date to minimal  possible date to run the follow-up application&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|Offset in months from the current date to maximal  possible date to run the follow-up application&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|the scheduled date should fit the Minimal offset –  Maximal offset criteria&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|Where to store the scheduler?&lt;br /&gt;
|pharmacy.site.renew&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|Which application should be scheduled?&lt;br /&gt;
|application.pharmacy.renew&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|Display date only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== registers ==&lt;br /&gt;
             Provides assigning numbers, registration date, and expiration date like a typical filing system register does.&lt;br /&gt;
&lt;br /&gt;
Figure 14. The register component&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|Offset in months from the current date to the minimal  possible registration date&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|Offset in months from the current date to the maximal  possible expiration date&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|the dates should fit the Minimal offset – Maximal  offset criteria&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|If true, the dates will be available. Otherwise the  registration only.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|Where to store the register?&lt;br /&gt;
|pharmacy.site.renew&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|Which application should be scheduled?&lt;br /&gt;
|application.pharmacy.renew&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|Display date only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|The registration number prefix. For most filing  systems – code of cases&lt;br /&gt;
|MR/&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== atc ==&lt;br /&gt;
             ATC codes for medicines&lt;br /&gt;
&lt;br /&gt;
Figure 15. The ATC codes component&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|Require at least one code selected&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|Where to store the selected codes?&lt;br /&gt;
|medicinalproduct.productclassification&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|Display date only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== legacy ==&lt;br /&gt;
             Allows select objects uploaded from the legacy data. Applicable for manual legacy data export, usage the legacy data for new applications, etc.&lt;br /&gt;
&lt;br /&gt;
Figure 16. The legacy data component&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|Require the selection&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|Where to store the selected codes?&lt;br /&gt;
|pharmacies.registered.legacy&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|The kind of legacy data, e.g., pharmacies, medicines,  etc.&lt;br /&gt;
|legacy.pharmacies&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|Display date only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== intervals ==&lt;br /&gt;
             The interval between two dates.&lt;br /&gt;
&lt;br /&gt;
Figure 17. The interval component&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Parameter'''&lt;br /&gt;
|'''Usage'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Minimal Offset&lt;br /&gt;
|The length of the interval in months&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Maximal Offset&lt;br /&gt;
|The max in the interval, zero means no restrictions&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|required&lt;br /&gt;
|Minimal Offset and Maximal offset constraints should  be applied&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|mult&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;3&amp;quot; |Auxiliary  Data&lt;br /&gt;
|-&lt;br /&gt;
|url&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|dictUrl&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|auxURL&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|readOnly&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|unique&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|The pattern for the field or file names&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----[1]&lt;br /&gt;
&lt;br /&gt;
[2] In case if jpg, jpeg or png file will be uploaded. For other types of uploaded files will be ignored&lt;br /&gt;
&lt;br /&gt;
[3] &amp;lt;nowiki&amp;gt;https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file&amp;lt;/nowiki&amp;gt; - see attribute “accept”&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_2&amp;diff=191</id>
		<title>OpenRIMS-RPM - Workflow Configuration Part 2</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Configuration_Part_2&amp;diff=191"/>
		<updated>2025-01-15T18:51:42Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section describes how to configure submission reciepts for workflows.&lt;br /&gt;
&lt;br /&gt;
The example will assume that a Workflow exists named &amp;quot;clinical.trial.workflow&amp;quot;&lt;br /&gt;
&lt;br /&gt;
All Receipt templates are kept under the '''System Administration -&amp;gt; Configurations -&amp;gt; Resources - images.design'''&lt;br /&gt;
&lt;br /&gt;
Under the &amp;quot;items&amp;quot; click '''Add''' to create a new Reciept.&lt;br /&gt;
&lt;br /&gt;
Give the new receipt a '''Name''' e.g. &amp;quot;CT Application Receipt&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Create a '''URL''' for the receipt which must be the name of the '''Workflow''' it should be linked to followed by &amp;quot;.receipt&amp;quot; e.g. &amp;quot;clinical.trial.workflow.receipt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Verify the receipt in your test environment before deploying to a live server.&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=190</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=190"/>
		<updated>2024-08-23T12:45:17Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html rewrite&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
Make a choice:&lt;br /&gt;
&lt;br /&gt;
For '''ARM64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
For '''x32_64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/91f66f75-bd3e-48f1-acb9-99c0da753f96/42c47999ee4c4d108774536afe5da160/aspnetcore-runtime-6.0.33-linux-x64.tar.gz&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Now download the required files from the OpenRIMS website:&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo wget  https://www.openrims.org/wp-content/uploads/2024/08/openrims-pv.20240618.3.0.0.0.beta_.bf_.zip&lt;br /&gt;
Unzip and:&lt;br /&gt;
&lt;br /&gt;
# Move app folder to /var/www/html/app using mc and set permissions and owner&lt;br /&gt;
# Move api folder to /var/www/html/api and set permissions and owner&lt;br /&gt;
&lt;br /&gt;
Make the .dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x OpenRIMS.PV.Main.API.dll&lt;br /&gt;
Edit the API appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
A good API appsettings.json file looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;ConnectionString&amp;quot;: &amp;quot;Server=localhost,3306;Database=openrims-pv;User Id=pvuser; Password=P@55w0rd;Pooling=False;&amp;quot;&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet OpenRIMS.PV.Main.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
Lastly edit the APP appsettings.json file to set url target for api - remember to keep the correct syntax and https/http in place:&lt;br /&gt;
 sudo nano /var/www/html/app/appsettings.json&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspv.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / https://'''subdomain'''.openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / [https://subdomain-api https://'''subdomain-api'''].openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
=== '''Post SSL Configuration''' ===&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=189</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=189"/>
		<updated>2024-08-21T21:44:42Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html rewrite&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
Make a choice:&lt;br /&gt;
&lt;br /&gt;
For '''ARM64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
For '''x32_64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/91f66f75-bd3e-48f1-acb9-99c0da753f96/42c47999ee4c4d108774536afe5da160/aspnetcore-runtime-6.0.33-linux-x64.tar.gz&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Now download the required files from the OpenRIMS website:&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo wget  https://www.openrims.org/wp-content/uploads/2024/08/openrims-pv.20240618.3.0.0.0.beta_.bf_.zip&lt;br /&gt;
Unzip and:&lt;br /&gt;
&lt;br /&gt;
# Move app folder to /var/www/html/app using mc and set permissions and owner&lt;br /&gt;
# Move api folder to /var/www/html/api and set permissions and owner&lt;br /&gt;
&lt;br /&gt;
Make the .dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x OpenRIMS.PV.Main.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
A good appsettings.json file looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;ConnectionString&amp;quot;: &amp;quot;Server=localhost,3306;Database=openrims-pv;User Id=pvuser; Password=P@55w0rd;Pooling=False;&amp;quot;&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet OpenRIMS.PV.Main.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspv.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / https://'''subdomain'''.openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / [https://subdomain-api https://'''subdomain-api'''].openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
=== '''Post SSL Configuration''' ===&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=188</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=188"/>
		<updated>2024-08-21T21:42:04Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html rewrite&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
Make a choice:&lt;br /&gt;
&lt;br /&gt;
For '''ARM64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
For '''x32_64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/91f66f75-bd3e-48f1-acb9-99c0da753f96/42c47999ee4c4d108774536afe5da160/aspnetcore-runtime-6.0.33-linux-x64.tar.gz&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Now download the required files from the OpenRIMS website:&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo wget  https://www.openrims.org/wp-content/uploads/2024/08/openrims-pv.20240618.3.0.0.0.beta_.bf_.zip&lt;br /&gt;
Unzip to /var/www/html/app using mc&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/api using mc&lt;br /&gt;
&lt;br /&gt;
Make dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x OpenRIMS.PV.Main.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
A good appsettings.json file looks like this:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;ConnectionString&amp;quot;: &amp;quot;Server=localhost,3306;Database=openrims-pv;User Id=pvuser; Password=P@55w0rd;Pooling=False;&amp;quot;&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet OpenRIMS.PV.Main.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspv.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / https://'''subdomain'''.openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / [https://subdomain-api https://'''subdomain-api'''].openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
=== '''Post SSL Configuration''' ===&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=187</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=187"/>
		<updated>2024-08-21T20:21:40Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
Make a choice:&lt;br /&gt;
&lt;br /&gt;
For '''ARM64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
For '''x32_64''' use&lt;br /&gt;
 curl -SL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/91f66f75-bd3e-48f1-acb9-99c0da753f96/42c47999ee4c4d108774536afe5da160/aspnetcore-runtime-6.0.33-linux-x64.tar.gz&lt;br /&gt;
Then run:&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Now download the required files from the OpenRIMS website:&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo wget  https://www.openrims.org/wp-content/uploads/2024/08/openrims-pv.20240618.3.0.0.0.beta_.bf_.zip&lt;br /&gt;
Unzip to /var/www/html/app using mc&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/api using mc&lt;br /&gt;
&lt;br /&gt;
Make dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x OpenRIMS.PV.Main.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
A good connection string looks like this:&lt;br /&gt;
 &amp;quot;ConnectionString&amp;quot;: &amp;quot;Server=localhost,3306;Database=openrims-pv;User Id=pvuser; Password=P@55w0rd;Pooling=False;&amp;quot;&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspvm.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / https://'''subdomain'''.openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / [https://subdomain-api https://'''subdomain-api'''].openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
=== '''Post SSL Configuration''' ===&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS_-_Database_Cleaning_Part_1&amp;diff=186</id>
		<title>OpenRIMS - Database Cleaning Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS_-_Database_Cleaning_Part_1&amp;diff=186"/>
		<updated>2024-07-23T17:02:05Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Purpose =&lt;br /&gt;
The OpenRIMS-RP database contains configuration and user-defined data. The configuration data is defined by Supervisor. This data intends to manage electronic forms and workflows of applications. The user-defined data is data collected using electronic forms of applications and workflows.&lt;br /&gt;
&lt;br /&gt;
Before the database will become production it is necessary to define the primary configuration data. Because the configuration data is particular for a country, this data should be created and tested on the sandbox or demo installation of OpenRIMS-RP.&lt;br /&gt;
&lt;br /&gt;
While testing, the test data will be created. Thus, to prepare a production database it will be necessary to clean up all user-defined data that was created while testing, presenting, and, possible, learning.&lt;br /&gt;
&lt;br /&gt;
For the current release, there is no special defined software to clean up the database, because it is an on-time operation.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
* MySQL Workbench is installed&lt;br /&gt;
* Connection to the database is established&lt;br /&gt;
* Connection rights to the pdx2 database allow at least select, delete, insert, execute, update, show view&lt;br /&gt;
* The below cleaning script&lt;br /&gt;
&lt;br /&gt;
The conceptual model[1] of the OpenRIMS-RP database is a forest of data trees built upon a relation logical model using the MySQL database engine.&lt;br /&gt;
&lt;br /&gt;
The stored procedure “print_tree” allows selecting all branches of a data tree from the root or any node.&lt;br /&gt;
&lt;br /&gt;
Any tree in this forest is a configuration or user-defined data, but not both. The clean database assumed the absence of user-defined data. To remove the user-defined data all data trees that contain user-defined data should be removed.&lt;br /&gt;
&lt;br /&gt;
To remove a data tree, it will be enough to remove the data tree root using the “remove_branch” stored procedure.&lt;br /&gt;
&lt;br /&gt;
Thus, it will be necessary to recognize all roots of user-defined data and remove them by the “remove_branch” stored procedure. &lt;br /&gt;
&lt;br /&gt;
Currently, there are no SQL queries to select roots of the user-defined-data roots, however, SQL queries to select roots of the configurations have been developed for Administrative features implementations.&lt;br /&gt;
&lt;br /&gt;
The approach is to select all roots of configurations and, then, subtract them from the whole roots. This is described in detail in the sections just below the &amp;quot;Generate cleaning script&amp;quot; here:.&lt;br /&gt;
&lt;br /&gt;
= Generate cleaning script =&lt;br /&gt;
Login to MySQL CLI or Workbench.&lt;br /&gt;
&lt;br /&gt;
Select you OpenRIMS database and open a new query.&lt;br /&gt;
 SELECT concat('call remove_branch(',c.ID, ');', '-- ', c.Identifier) as 'sql'&lt;br /&gt;
&lt;br /&gt;
 FROM tree_userdefined c&lt;br /&gt;
'''This script may run for a long time!'''&lt;br /&gt;
&lt;br /&gt;
The results table created is the actual cleaning script. Now &amp;quot;Select All&amp;quot; from the table, copy and then paste into a New Query.&lt;br /&gt;
&lt;br /&gt;
Click Run/Execute.&lt;br /&gt;
&lt;br /&gt;
'''This script will also run for a long time!'''&lt;br /&gt;
&lt;br /&gt;
After the script has executed please login to OpenRIMS as administrator and verify that the script has cleaned the workflows.&lt;br /&gt;
&lt;br /&gt;
The easiest way is to go to the Application Tracker of Monitor as verify that table is empty.  &lt;br /&gt;
&lt;br /&gt;
== SQL Description of the cleaning process ==&lt;br /&gt;
&lt;br /&gt;
=== '''Do NOT run the below scripts individually!''' ===&lt;br /&gt;
They are for educational purpose only but might assist in troubleshooting.&lt;br /&gt;
&lt;br /&gt;
=== Roots of configurations ===&lt;br /&gt;
The data tree roots as well as all data tree nodes are recorded in the “concept” table. All roots can be selected using the “tree_roots” view.&lt;br /&gt;
&lt;br /&gt;
This view is a result of SQL query&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
      `concept`.`ID` AS `ID`,&lt;br /&gt;
&lt;br /&gt;
      `concept`.`Identifier` AS `Identifier`&lt;br /&gt;
&lt;br /&gt;
   FROM&lt;br /&gt;
&lt;br /&gt;
      `concept`&lt;br /&gt;
&lt;br /&gt;
       LEFT JOIN `closure` `clos` ON `clos`.`childID` = `concept`.`ID`  AND (`clos`.`Level` &amp;lt;&amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   WHERE&lt;br /&gt;
&lt;br /&gt;
      ISNULL(`clos`.`ID`) and `concept`.`Active` -- only roots&lt;br /&gt;
&lt;br /&gt;
Each data tree root is defined by unique field “Identifier”.&lt;br /&gt;
&lt;br /&gt;
The data configuration trees are:&lt;br /&gt;
&lt;br /&gt;
1.     Authorities and users&lt;br /&gt;
&lt;br /&gt;
2.     Workflows&lt;br /&gt;
&lt;br /&gt;
3.     Dictionaries&lt;br /&gt;
&lt;br /&gt;
4.     Resources&lt;br /&gt;
&lt;br /&gt;
5.     Files uploaded to resources&lt;br /&gt;
&lt;br /&gt;
6.     Configurations of data&lt;br /&gt;
&lt;br /&gt;
7.     Configurations of reports&lt;br /&gt;
&lt;br /&gt;
8.     Tiles&lt;br /&gt;
&lt;br /&gt;
9.     Legacy data&lt;br /&gt;
&lt;br /&gt;
These configurations will not be extended until the next version of OpenRIMS-RP software.&lt;br /&gt;
&lt;br /&gt;
=== Authorities and users ===&lt;br /&gt;
              All users are branches of a tree. The root of this tree is “user.data”.&lt;br /&gt;
&lt;br /&gt;
All authorities are branches of a tree “organization.authority”.&lt;br /&gt;
&lt;br /&gt;
              The SQL query to select roots:&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('organization.authority', 'user.data')&lt;br /&gt;
&lt;br /&gt;
=== Workflow definitions ===&lt;br /&gt;
              Workflow definitions allow control user’s application processing.&lt;br /&gt;
&lt;br /&gt;
              The definition of a workflow is stored in a tree. The root URL is “configuration.”URL of a workflow”, e.g., “configuration.application.retail.site.owned.pvt”. All root URLs can be gotten from lifecycle dictionaries:&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.deregistration&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.amendments&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.applications&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.renewal&lt;br /&gt;
&lt;br /&gt;
·       dictionary.shutdown.applications&lt;br /&gt;
&lt;br /&gt;
·       dictionary.host.applications&lt;br /&gt;
&lt;br /&gt;
The SQL query to select all root URL’s from the life cycle dictionaries is:&lt;br /&gt;
&lt;br /&gt;
SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              The SQL to select all workflow definition roots is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- query for workflow definition URLs from the lifecycle dictionaries&lt;br /&gt;
&lt;br /&gt;
                                             SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
                                             join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
                                             )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Dictionaries ===&lt;br /&gt;
              Dictionaries contains pre-defined classifiers used by data input forms. Each dictionary is a tree.&lt;br /&gt;
&lt;br /&gt;
              By the agreement, all URLs of dictionaries should start with “dictionary.”. Thus, SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier like 'dictionary.%'&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
              The definition of a resource consists of:&lt;br /&gt;
&lt;br /&gt;
1.     Resource definition&lt;br /&gt;
&lt;br /&gt;
2.     Data configuration&lt;br /&gt;
&lt;br /&gt;
3.     Dictionary&lt;br /&gt;
&lt;br /&gt;
4.     Stored files&lt;br /&gt;
&lt;br /&gt;
The data configuration and dictionary are common configuration trees,  that can be gotten by the appropriate SQLs (see above and below)&lt;br /&gt;
&lt;br /&gt;
Resource definitions are branches of the root URL “configuration.resources”.&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
=== Files, uploaded to resources ===&lt;br /&gt;
The resource files are stored in a tree for each resource. The root URL is defined in the resource data configurations. A data configuration of a resource is a uniform data configuration.  Thus, it is necessary:&lt;br /&gt;
&lt;br /&gt;
1.     Select URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
2.     Select data configurations for all resources, using data configuration URLs&lt;br /&gt;
&lt;br /&gt;
3.     Select URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
4.     Select file trees, using the URLs&lt;br /&gt;
&lt;br /&gt;
URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
item.Active and&lt;br /&gt;
&lt;br /&gt;
c.Active and&lt;br /&gt;
&lt;br /&gt;
c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Data configurations for all resources:&lt;br /&gt;
&lt;br /&gt;
SELECT conf.ID, conf.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
and c.Active&lt;br /&gt;
&lt;br /&gt;
and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                              -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                              SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                              FROM concept c&lt;br /&gt;
&lt;br /&gt;
                              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                              join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                              join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                              join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                              left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                              where&lt;br /&gt;
&lt;br /&gt;
                              clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                              item.Active and&lt;br /&gt;
&lt;br /&gt;
                               c.Active and&lt;br /&gt;
&lt;br /&gt;
                               c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
)            &lt;br /&gt;
&lt;br /&gt;
URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
              FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
   -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
              join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
              join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
              join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
   -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
              join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
   -- roots&lt;br /&gt;
&lt;br /&gt;
              left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
              where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
               and c.Active&lt;br /&gt;
&lt;br /&gt;
               and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
               and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                             SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             item.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
               )&lt;br /&gt;
&lt;br /&gt;
File trees:&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
&lt;br /&gt;
       -- URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
       SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
       FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
  -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
       join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
       join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
       join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
       join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
  -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
       join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
  -- roots&lt;br /&gt;
&lt;br /&gt;
       left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
       where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
        and c.Active&lt;br /&gt;
&lt;br /&gt;
        and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
        and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                      -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                      SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                      FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                      join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                      join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                      join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                      join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                      left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                      where&lt;br /&gt;
&lt;br /&gt;
                                      clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                      item.Active and&lt;br /&gt;
&lt;br /&gt;
                                       c.Active and&lt;br /&gt;
&lt;br /&gt;
                                       c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Configurations of data ===&lt;br /&gt;
              Configurations of data intends to manage on-screen forms for configurations and user-defined data  For each form the configuration allows to assign:&lt;br /&gt;
&lt;br /&gt;
·       Form layout on a screen&lt;br /&gt;
&lt;br /&gt;
·       Data input fields, i.e., text, numeric, dates, logical&lt;br /&gt;
&lt;br /&gt;
·       Data input components, i.e., dictionaries, registers, resource downloads, etc.&lt;br /&gt;
&lt;br /&gt;
·       Data validation rules&lt;br /&gt;
&lt;br /&gt;
              Details may be found here (MSH, 2022)&lt;br /&gt;
&lt;br /&gt;
              For each data form the configuration is a branch in the tree with URL “configuration.data”&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
=== Configurations of reports ===&lt;br /&gt;
              Configurations of internal reports intend to define parameters to execute internal reports. For each report configuration is a branch in a tree with root URL “report.configuration”&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('report.configuration')&lt;br /&gt;
&lt;br /&gt;
=== Tiles ===&lt;br /&gt;
              Tiles is a system dictionary “dictionary.system.tiles”&lt;br /&gt;
&lt;br /&gt;
=== Legacy Data ===&lt;br /&gt;
              The legacy data may be placed to one or more trees. The URLs of the roots should be clarified for the installation. For Nepal database URLs are “system.import.legacy.data”, “legacy.pharmacies” and “legacy.ws”.&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('legacy.pharmacies', 'legacy.ws', 'system.import.legacy.data')&lt;br /&gt;
&lt;br /&gt;
=== Put it all together ===&lt;br /&gt;
Create two database views:&lt;br /&gt;
&lt;br /&gt;
'''tree_configurations:'''&lt;br /&gt;
&lt;br /&gt;
-- 1.        Authorities and users&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('organization.authority', 'user.data')&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 2.        Workflows&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- query for workflow definition URLs from the lifecycle dictionaries&lt;br /&gt;
&lt;br /&gt;
                                             SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
                                             join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
                                             )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 3.        Dictionaries&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier like 'dictionary.%'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 4.        Resources&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 5.       Files uploaded to resources&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
&lt;br /&gt;
              -- URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
              SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
              FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
   -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
              join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
              join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
              join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
   -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
              join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
   -- roots&lt;br /&gt;
&lt;br /&gt;
              left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
              where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
               and c.Active&lt;br /&gt;
&lt;br /&gt;
               and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
               and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                             SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             item.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
               )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 6.        Configurations of data&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 7.        Configurations of reports&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('report.configuration')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 8.        Tiles are a dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- 9.        Legacy data&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('legacy.pharmacies', 'legacy.ws', 'system.import.legacy.data')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''tree_userdefined:'''&lt;br /&gt;
&lt;br /&gt;
SELECT c.*&lt;br /&gt;
&lt;br /&gt;
   FROM&lt;br /&gt;
&lt;br /&gt;
              `concept` `c`&lt;br /&gt;
&lt;br /&gt;
       LEFT JOIN `closure` `clo` ON `clo`.`childID` = `c`.`ID`&lt;br /&gt;
&lt;br /&gt;
           AND (`clo`.`Level` &amp;lt;&amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   WHERE&lt;br /&gt;
&lt;br /&gt;
      ISNULL(`clo`.`ID`) AND `c`.`Active`&lt;br /&gt;
&lt;br /&gt;
           AND NOT  `c`.`ID` IN (SELECT&lt;br /&gt;
&lt;br /&gt;
              `tree_configurations`.`ID`&lt;br /&gt;
&lt;br /&gt;
           FROM&lt;br /&gt;
&lt;br /&gt;
               `tree_configurations`)&lt;br /&gt;
&lt;br /&gt;
----[1] sciencedirect.com/topics/computer-science/conceptual-data-model&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS_-_Database_Cleaning_Part_1&amp;diff=185</id>
		<title>OpenRIMS - Database Cleaning Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS_-_Database_Cleaning_Part_1&amp;diff=185"/>
		<updated>2024-07-23T16:06:48Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Generate cleaning script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Purpose =&lt;br /&gt;
The OpenRIMS-RP database contains configuration and user-defined data. The configuration data is defined by Supervisor. This data intends to manage electronic forms and workflows of applications. The user-defined data is data collected using electronic forms of applications and workflows.&lt;br /&gt;
&lt;br /&gt;
Before the database will become production it is necessary to define the primary configuration data. Because the configuration data is particular for a country, this data should be created and tested on the sandbox or demo installation of OpenRIMS-RP.&lt;br /&gt;
&lt;br /&gt;
While testing, the test data will be created. Thus, to prepare a production database it will be necessary to clean up all user-defined data that was created while testing, presenting, and, possible, learning.&lt;br /&gt;
&lt;br /&gt;
For the current release, there is no special defined software to clean up the database, because it is an on-time operation.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
* MySQL Workbench is installed&lt;br /&gt;
* Connection to the database is established&lt;br /&gt;
* Connection rights to the pdx2 database allow at least select, delete, insert, execute, update, show view&lt;br /&gt;
* The below cleaning script&lt;br /&gt;
&lt;br /&gt;
The conceptual model[1] of the OpenRIMS-RP database is a forest of data trees built upon a relation logical model using the MySQL database engine.&lt;br /&gt;
&lt;br /&gt;
The stored procedure “print_tree” allows selecting all branches of a data tree from the root or any node.&lt;br /&gt;
&lt;br /&gt;
Any tree in this forest is a configuration or user-defined data, but not both. The clean database assumed the absence of user-defined data. To remove the user-defined data all data trees that contain user-defined data should be removed.&lt;br /&gt;
&lt;br /&gt;
To remove a data tree, it will be enough to remove the data tree root using the “remove_branch” stored procedure.&lt;br /&gt;
&lt;br /&gt;
Thus, it will be necessary to recognize all roots of user-defined data and remove them by the “remove_branch” stored procedure. &lt;br /&gt;
&lt;br /&gt;
Currently, there are no SQL queries to select roots of the user-defined-data roots, however, SQL queries to select roots of the configurations have been developed for Administrative features implementations.&lt;br /&gt;
&lt;br /&gt;
The approach is to select all roots of configurations and, then, subtract them from the whole roots. This is described in detail in the sections just below the &amp;quot;Generate cleaning script&amp;quot; here:.&lt;br /&gt;
&lt;br /&gt;
= Generate cleaning script =&lt;br /&gt;
Login to MySQL CLI or Workbench.&lt;br /&gt;
&lt;br /&gt;
Select you OpenRIMS database and open a new query.&lt;br /&gt;
 SELECT concat('call remove_branch(',c.ID, ');', '-- ', c.Identifier) as 'sql'&lt;br /&gt;
&lt;br /&gt;
 FROM tree_userdefined c&lt;br /&gt;
'''This script may run a long time!'''&lt;br /&gt;
&lt;br /&gt;
After the script run concludes please login as administrator and verify that the script has cleaned the workflows.&lt;br /&gt;
&lt;br /&gt;
The easiest way is to go to the  &lt;br /&gt;
&lt;br /&gt;
== SQL Description of the cleaning process ==&lt;br /&gt;
&lt;br /&gt;
=== '''Do NOT run the below scripts individually!''' ===&lt;br /&gt;
They are for educational purpose only but might assist in troubleshooting.&lt;br /&gt;
&lt;br /&gt;
=== Roots of configurations ===&lt;br /&gt;
The data tree roots as well as all data tree nodes are recorded in the “concept” table. All roots can be selected using the “tree_roots” view.&lt;br /&gt;
&lt;br /&gt;
This view is a result of SQL query&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
      `concept`.`ID` AS `ID`,&lt;br /&gt;
&lt;br /&gt;
      `concept`.`Identifier` AS `Identifier`&lt;br /&gt;
&lt;br /&gt;
   FROM&lt;br /&gt;
&lt;br /&gt;
      `concept`&lt;br /&gt;
&lt;br /&gt;
       LEFT JOIN `closure` `clos` ON `clos`.`childID` = `concept`.`ID`  AND (`clos`.`Level` &amp;lt;&amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   WHERE&lt;br /&gt;
&lt;br /&gt;
      ISNULL(`clos`.`ID`) and `concept`.`Active` -- only roots&lt;br /&gt;
&lt;br /&gt;
Each data tree root is defined by unique field “Identifier”.&lt;br /&gt;
&lt;br /&gt;
The data configuration trees are:&lt;br /&gt;
&lt;br /&gt;
1.     Authorities and users&lt;br /&gt;
&lt;br /&gt;
2.     Workflows&lt;br /&gt;
&lt;br /&gt;
3.     Dictionaries&lt;br /&gt;
&lt;br /&gt;
4.     Resources&lt;br /&gt;
&lt;br /&gt;
5.     Files uploaded to resources&lt;br /&gt;
&lt;br /&gt;
6.     Configurations of data&lt;br /&gt;
&lt;br /&gt;
7.     Configurations of reports&lt;br /&gt;
&lt;br /&gt;
8.     Tiles&lt;br /&gt;
&lt;br /&gt;
9.     Legacy data&lt;br /&gt;
&lt;br /&gt;
These configurations will not be extended until the next version of OpenRIMS-RP software.&lt;br /&gt;
&lt;br /&gt;
=== Authorities and users ===&lt;br /&gt;
              All users are branches of a tree. The root of this tree is “user.data”.&lt;br /&gt;
&lt;br /&gt;
All authorities are branches of a tree “organization.authority”.&lt;br /&gt;
&lt;br /&gt;
              The SQL query to select roots:&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('organization.authority', 'user.data')&lt;br /&gt;
&lt;br /&gt;
=== Workflow definitions ===&lt;br /&gt;
              Workflow definitions allow control user’s application processing.&lt;br /&gt;
&lt;br /&gt;
              The definition of a workflow is stored in a tree. The root URL is “configuration.”URL of a workflow”, e.g., “configuration.application.retail.site.owned.pvt”. All root URLs can be gotten from lifecycle dictionaries:&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.deregistration&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.amendments&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.applications&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.renewal&lt;br /&gt;
&lt;br /&gt;
·       dictionary.shutdown.applications&lt;br /&gt;
&lt;br /&gt;
·       dictionary.host.applications&lt;br /&gt;
&lt;br /&gt;
The SQL query to select all root URL’s from the life cycle dictionaries is:&lt;br /&gt;
&lt;br /&gt;
SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              The SQL to select all workflow definition roots is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- query for workflow definition URLs from the lifecycle dictionaries&lt;br /&gt;
&lt;br /&gt;
                                             SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
                                             join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
                                             )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Dictionaries ===&lt;br /&gt;
              Dictionaries contains pre-defined classifiers used by data input forms. Each dictionary is a tree.&lt;br /&gt;
&lt;br /&gt;
              By the agreement, all URLs of dictionaries should start with “dictionary.”. Thus, SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier like 'dictionary.%'&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
              The definition of a resource consists of:&lt;br /&gt;
&lt;br /&gt;
1.     Resource definition&lt;br /&gt;
&lt;br /&gt;
2.     Data configuration&lt;br /&gt;
&lt;br /&gt;
3.     Dictionary&lt;br /&gt;
&lt;br /&gt;
4.     Stored files&lt;br /&gt;
&lt;br /&gt;
The data configuration and dictionary are common configuration trees,  that can be gotten by the appropriate SQLs (see above and below)&lt;br /&gt;
&lt;br /&gt;
Resource definitions are branches of the root URL “configuration.resources”.&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
=== Files, uploaded to resources ===&lt;br /&gt;
The resource files are stored in a tree for each resource. The root URL is defined in the resource data configurations. A data configuration of a resource is a uniform data configuration.  Thus, it is necessary:&lt;br /&gt;
&lt;br /&gt;
1.     Select URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
2.     Select data configurations for all resources, using data configuration URLs&lt;br /&gt;
&lt;br /&gt;
3.     Select URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
4.     Select file trees, using the URLs&lt;br /&gt;
&lt;br /&gt;
URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
item.Active and&lt;br /&gt;
&lt;br /&gt;
c.Active and&lt;br /&gt;
&lt;br /&gt;
c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Data configurations for all resources:&lt;br /&gt;
&lt;br /&gt;
SELECT conf.ID, conf.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
and c.Active&lt;br /&gt;
&lt;br /&gt;
and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                              -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                              SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                              FROM concept c&lt;br /&gt;
&lt;br /&gt;
                              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                              join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                              join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                              join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                              left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                              where&lt;br /&gt;
&lt;br /&gt;
                              clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                              item.Active and&lt;br /&gt;
&lt;br /&gt;
                               c.Active and&lt;br /&gt;
&lt;br /&gt;
                               c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
)            &lt;br /&gt;
&lt;br /&gt;
URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
              FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
   -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
              join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
              join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
              join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
   -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
              join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
   -- roots&lt;br /&gt;
&lt;br /&gt;
              left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
              where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
               and c.Active&lt;br /&gt;
&lt;br /&gt;
               and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
               and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                             SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             item.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
               )&lt;br /&gt;
&lt;br /&gt;
File trees:&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
&lt;br /&gt;
       -- URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
       SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
       FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
  -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
       join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
       join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
       join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
       join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
  -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
       join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
  -- roots&lt;br /&gt;
&lt;br /&gt;
       left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
       where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
        and c.Active&lt;br /&gt;
&lt;br /&gt;
        and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
        and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                      -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                      SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                      FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                      join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                      join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                      join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                      join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                      left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                      where&lt;br /&gt;
&lt;br /&gt;
                                      clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                      item.Active and&lt;br /&gt;
&lt;br /&gt;
                                       c.Active and&lt;br /&gt;
&lt;br /&gt;
                                       c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
=== Configurations of data ===&lt;br /&gt;
              Configurations of data intends to manage on-screen forms for configurations and user-defined data  For each form the configuration allows to assign:&lt;br /&gt;
&lt;br /&gt;
·       Form layout on a screen&lt;br /&gt;
&lt;br /&gt;
·       Data input fields, i.e., text, numeric, dates, logical&lt;br /&gt;
&lt;br /&gt;
·       Data input components, i.e., dictionaries, registers, resource downloads, etc.&lt;br /&gt;
&lt;br /&gt;
·       Data validation rules&lt;br /&gt;
&lt;br /&gt;
              Details may be found here (MSH, 2022)&lt;br /&gt;
&lt;br /&gt;
              For each data form the configuration is a branch in the tree with URL “configuration.data”&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
=== Configurations of reports ===&lt;br /&gt;
              Configurations of internal reports intend to define parameters to execute internal reports. For each report configuration is a branch in a tree with root URL “report.configuration”&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('report.configuration')&lt;br /&gt;
&lt;br /&gt;
=== Tiles ===&lt;br /&gt;
              Tiles is a system dictionary “dictionary.system.tiles”&lt;br /&gt;
&lt;br /&gt;
=== Legacy Data ===&lt;br /&gt;
              The legacy data may be placed to one or more trees. The URLs of the roots should be clarified for the installation. For Nepal database URLs are “system.import.legacy.data”, “legacy.pharmacies” and “legacy.ws”.&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('legacy.pharmacies', 'legacy.ws', 'system.import.legacy.data')&lt;br /&gt;
&lt;br /&gt;
=== Put it all together ===&lt;br /&gt;
Create two database views:&lt;br /&gt;
&lt;br /&gt;
'''tree_configurations:'''&lt;br /&gt;
&lt;br /&gt;
-- 1.        Authorities and users&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('organization.authority', 'user.data')&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 2.        Workflows&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- query for workflow definition URLs from the lifecycle dictionaries&lt;br /&gt;
&lt;br /&gt;
                                             SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
                                             join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
                                             )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 3.        Dictionaries&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier like 'dictionary.%'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 4.        Resources&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 5.       Files uploaded to resources&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
&lt;br /&gt;
              -- URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
              SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
              FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
   -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
              join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
              join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
              join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
   -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
              join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
   -- roots&lt;br /&gt;
&lt;br /&gt;
              left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
              where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
               and c.Active&lt;br /&gt;
&lt;br /&gt;
               and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
               and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                             SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             item.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
               )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 6.        Configurations of data&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 7.        Configurations of reports&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('report.configuration')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 8.        Tiles are a dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- 9.        Legacy data&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('legacy.pharmacies', 'legacy.ws', 'system.import.legacy.data')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''tree_userdefined:'''&lt;br /&gt;
&lt;br /&gt;
SELECT c.*&lt;br /&gt;
&lt;br /&gt;
   FROM&lt;br /&gt;
&lt;br /&gt;
              `concept` `c`&lt;br /&gt;
&lt;br /&gt;
       LEFT JOIN `closure` `clo` ON `clo`.`childID` = `c`.`ID`&lt;br /&gt;
&lt;br /&gt;
           AND (`clo`.`Level` &amp;lt;&amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   WHERE&lt;br /&gt;
&lt;br /&gt;
      ISNULL(`clo`.`ID`) AND `c`.`Active`&lt;br /&gt;
&lt;br /&gt;
           AND NOT  `c`.`ID` IN (SELECT&lt;br /&gt;
&lt;br /&gt;
              `tree_configurations`.`ID`&lt;br /&gt;
&lt;br /&gt;
           FROM&lt;br /&gt;
&lt;br /&gt;
               `tree_configurations`)&lt;br /&gt;
&lt;br /&gt;
----[1] sciencedirect.com/topics/computer-science/conceptual-data-model&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=184</id>
		<title>OpenRIMS-RPM - Installation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=184"/>
		<updated>2024-07-23T15:49:27Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Large Files Upload */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
This document describes deployment of OpenRIMS software on a default server.&lt;br /&gt;
&lt;br /&gt;
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.&lt;br /&gt;
&lt;br /&gt;
You should have the ability to install and configure programs and components/services in the selected operating system.&lt;br /&gt;
&lt;br /&gt;
Additionally you need experience on MySQL.&lt;br /&gt;
&lt;br /&gt;
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''&lt;br /&gt;
&lt;br /&gt;
== Overview of Server Requirements ==&lt;br /&gt;
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:&lt;br /&gt;
&lt;br /&gt;
=== Hardware Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Recommendation&lt;br /&gt;
|&lt;br /&gt;
|'''Initial Configuration and Testing Server'''&lt;br /&gt;
|'''Production Server'''&lt;br /&gt;
|-&lt;br /&gt;
|CPU&lt;br /&gt;
|1-2 cores&lt;br /&gt;
|8 cores&lt;br /&gt;
|-&lt;br /&gt;
|Memory&lt;br /&gt;
|At least 2 GB of free RAM&lt;br /&gt;
|At least 16 GB of free RAM&lt;br /&gt;
|-&lt;br /&gt;
|Harddrive&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|-&lt;br /&gt;
|Internet connection&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Operating System&lt;br /&gt;
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
Windows Server 2016 and above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Database:&lt;br /&gt;
|MySQL : Server 5.7 and Workbench 8.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Java:&lt;br /&gt;
|Oracle Java JDK 1.8&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
OpenJDK 1.8&lt;br /&gt;
&lt;br /&gt;
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|OpenRIMS application &amp;amp; database:&lt;br /&gt;
|OpenRIMS Java application binary&lt;br /&gt;
AND&lt;br /&gt;
&lt;br /&gt;
OpenRIMS demo database&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;nowiki&amp;gt;https://github.com/MSH/Pharmadex2/tree/main/database&amp;lt;/nowiki&amp;gt;[1])&lt;br /&gt;
&lt;br /&gt;
''(Please refer to the README.md file)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Google Oauth ID &amp;amp; Secret&lt;br /&gt;
|A Google Mail account for OAuth Login SSO&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== The OpenRIMS Installation Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Prepare to install ===&lt;br /&gt;
1.      Install the following using the respective vendor’s deployment manuals:&lt;br /&gt;
&lt;br /&gt;
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0&lt;br /&gt;
&lt;br /&gt;
1.2.   Java JDK 1.8&lt;br /&gt;
&lt;br /&gt;
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!&lt;br /&gt;
&lt;br /&gt;
''Ubuntu MySQL CLI hint (&amp;lt;code&amp;gt;CREATE DATABASE pdx2&amp;lt;/code&amp;gt;. And restore it: $ &amp;lt;code&amp;gt;mysql -u username -p pdx2 &amp;lt; DumpPdx2.sql&amp;lt;/code&amp;gt;)''&lt;br /&gt;
&lt;br /&gt;
3.      Copy the binary application &amp;lt;code&amp;gt;pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;application.properties&amp;lt;/code&amp;gt; to a dedicated user folder, e.g. /home/{username}/applications/openrims&lt;br /&gt;
&lt;br /&gt;
== Post-Installation OpenRIMS Configurations ==&lt;br /&gt;
&lt;br /&gt;
=== Local TCP/IP port ===&lt;br /&gt;
Adjust the application.properties file for initial configuration as described below.&lt;br /&gt;
&lt;br /&gt;
When initial configuration is concluded you should disable Variables Edit and Cloning of Workflows.&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.url = jdbc:mysql://localhost/'''openrimsre'''?useSSL=false&amp;amp;useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8&amp;amp;'''serverTimezone=Europe/Kiev'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.username = '''username'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.password = '''password'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''File Size Limit for Upload''' ====&lt;br /&gt;
Large file uploads can be enabled but is not recommended. A separate repository should be identified like a Document Management System (DMS) e.g. Alfresco Community Edition or Google Drive.&lt;br /&gt;
&lt;br /&gt;
To enable large file upload the server administrator must (''example is max 200Mb file''):&lt;br /&gt;
&lt;br /&gt;
# Add following line to MySQL configuration file in the [mysqld] section: &amp;lt;code&amp;gt;max_allowed_packet=200Mb&amp;lt;/code&amp;gt;&lt;br /&gt;
# Modify the following two lines in the application.properties file: &amp;lt;code&amp;gt;spring.servlet.multipart.max-file-size=200MB&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;spring.servlet.multipart.max-request-size=200MB&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Logs ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;logging.file.path=/'''home/user/openrimsre/log'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Recommended setting: '''logging.file.path= ./log/'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration it will be necessary to copy Client ID and Client secret to the application.properties&lt;br /&gt;
&lt;br /&gt;
==== OATH2 ====&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-id=client_id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-secret=client_secret&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''SMTP Configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; SMPT Outgoing email settings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.username=NRAemail@gmail.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.password=MyPassword&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow System Edits for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;##&amp;lt;/nowiki&amp;gt; Developer Mode Status&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variables.properties.edit=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow Cloning of Workflows for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;code&amp;gt;pharmadex.allow.process.import=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install OpenRIMS as a service ==&lt;br /&gt;
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.&lt;br /&gt;
&lt;br /&gt;
'''Linux'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d&lt;br /&gt;
&lt;br /&gt;
Here are detailed steps for Ubuntu 22.04:&lt;br /&gt;
&lt;br /&gt;
# Copy file .service to /etc/systemd/system: &amp;lt;code&amp;gt;sudo cp openrims.service /etc/systemd/system&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit file .service and change Username '''and''' Execstart path.&lt;br /&gt;
# Start the service: &amp;lt;code&amp;gt;systemctl enable openrims.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change Owner of the java application to your user: &amp;lt;code&amp;gt;sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; OR &amp;lt;code&amp;gt;sudo cdmod 500 pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference here is a sample service file:&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Description=Pharmadex 2 UAT version (madagascar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;After=pharmadex.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;User=ubuntu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SuccessExitStatus=143&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Install]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WantedBy=multi-user.target&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
'''For Windows'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services&lt;br /&gt;
&lt;br /&gt;
== Provide access from the Internet ==&lt;br /&gt;
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2.&lt;br /&gt;
&lt;br /&gt;
The example of virtual server configuration for Apache 2 is in the binary distributive folder named “Linux” on GitHub.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 22.04 and Apache2 here are the steps:&lt;br /&gt;
&lt;br /&gt;
# Copy pharmadex.conf to apache folder e.g. /etc/apache2/sites-available&lt;br /&gt;
# Enable the site a2ensite pharmadex&lt;br /&gt;
Here is another sample Apache conf file with https enabled by [https://www.digitalocean.com/community/tutorials/how-to-use-certbot-standalone-mode-to-retrieve-let-s-encrypt-ssl-certificates-on-ubuntu-20-04 Letsencrypt]:&amp;lt;blockquote&amp;gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
Redirect permanent / &amp;lt;nowiki&amp;gt;https://openrims.yourdomain.com/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
SSLEngine On&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile C:\Certbot\live\openrims.yourdomain.com\fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile C:\Certbot\live\openrims.yourdomain.com\privkey.pem&lt;br /&gt;
&lt;br /&gt;
SSLProtocol         all -SSLv3 -TLSv1 -TLSv1.1&lt;br /&gt;
&lt;br /&gt;
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&lt;br /&gt;
&lt;br /&gt;
SSLHonorCipherOrder on&lt;br /&gt;
&lt;br /&gt;
SSLCompression      off&lt;br /&gt;
&lt;br /&gt;
SSLSessionTickets   off&lt;br /&gt;
&lt;br /&gt;
SSLSessionCacheTimeout  300&lt;br /&gt;
&lt;br /&gt;
ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPass &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPassReverse &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Google Authentication ==&lt;br /&gt;
LINK: See [[OpenRIMS - Installation Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Special Configuration ==&lt;br /&gt;
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''&lt;br /&gt;
----[1] For current, available only to MSH staff&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=183</id>
		<title>OpenRIMS-RPM - Installation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=183"/>
		<updated>2024-07-23T15:48:34Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Database */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
This document describes deployment of OpenRIMS software on a default server.&lt;br /&gt;
&lt;br /&gt;
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.&lt;br /&gt;
&lt;br /&gt;
You should have the ability to install and configure programs and components/services in the selected operating system.&lt;br /&gt;
&lt;br /&gt;
Additionally you need experience on MySQL.&lt;br /&gt;
&lt;br /&gt;
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''&lt;br /&gt;
&lt;br /&gt;
== Overview of Server Requirements ==&lt;br /&gt;
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:&lt;br /&gt;
&lt;br /&gt;
=== Hardware Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Recommendation&lt;br /&gt;
|&lt;br /&gt;
|'''Initial Configuration and Testing Server'''&lt;br /&gt;
|'''Production Server'''&lt;br /&gt;
|-&lt;br /&gt;
|CPU&lt;br /&gt;
|1-2 cores&lt;br /&gt;
|8 cores&lt;br /&gt;
|-&lt;br /&gt;
|Memory&lt;br /&gt;
|At least 2 GB of free RAM&lt;br /&gt;
|At least 16 GB of free RAM&lt;br /&gt;
|-&lt;br /&gt;
|Harddrive&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|-&lt;br /&gt;
|Internet connection&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Operating System&lt;br /&gt;
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
Windows Server 2016 and above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Database:&lt;br /&gt;
|MySQL : Server 5.7 and Workbench 8.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Java:&lt;br /&gt;
|Oracle Java JDK 1.8&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
OpenJDK 1.8&lt;br /&gt;
&lt;br /&gt;
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|OpenRIMS application &amp;amp; database:&lt;br /&gt;
|OpenRIMS Java application binary&lt;br /&gt;
AND&lt;br /&gt;
&lt;br /&gt;
OpenRIMS demo database&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;nowiki&amp;gt;https://github.com/MSH/Pharmadex2/tree/main/database&amp;lt;/nowiki&amp;gt;[1])&lt;br /&gt;
&lt;br /&gt;
''(Please refer to the README.md file)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Google Oauth ID &amp;amp; Secret&lt;br /&gt;
|A Google Mail account for OAuth Login SSO&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== The OpenRIMS Installation Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Prepare to install ===&lt;br /&gt;
1.      Install the following using the respective vendor’s deployment manuals:&lt;br /&gt;
&lt;br /&gt;
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0&lt;br /&gt;
&lt;br /&gt;
1.2.   Java JDK 1.8&lt;br /&gt;
&lt;br /&gt;
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!&lt;br /&gt;
&lt;br /&gt;
''Ubuntu MySQL CLI hint (&amp;lt;code&amp;gt;CREATE DATABASE pdx2&amp;lt;/code&amp;gt;. And restore it: $ &amp;lt;code&amp;gt;mysql -u username -p pdx2 &amp;lt; DumpPdx2.sql&amp;lt;/code&amp;gt;)''&lt;br /&gt;
&lt;br /&gt;
3.      Copy the binary application &amp;lt;code&amp;gt;pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;application.properties&amp;lt;/code&amp;gt; to a dedicated user folder, e.g. /home/{username}/applications/openrims&lt;br /&gt;
&lt;br /&gt;
== Post-Installation OpenRIMS Configurations ==&lt;br /&gt;
&lt;br /&gt;
=== Local TCP/IP port ===&lt;br /&gt;
Adjust the application.properties file for initial configuration as described below.&lt;br /&gt;
&lt;br /&gt;
When initial configuration is concluded you should disable Variables Edit and Cloning of Workflows.&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.url = jdbc:mysql://localhost/'''openrimsre'''?useSSL=false&amp;amp;useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8&amp;amp;'''serverTimezone=Europe/Kiev'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.username = '''username'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.password = '''password'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Large Files Upload''' ====&lt;br /&gt;
Large file uploads can be enabled but is not recommended. A separate repository should be identified like a Document Management System (DMS) e.g. Alfresco Community Edition or Google Drive.&lt;br /&gt;
&lt;br /&gt;
To enable large file upload the server administrator must (''example is max 200Mb file''):&lt;br /&gt;
&lt;br /&gt;
# Add following line to MySQL configuration file in the [mysqld] section: &amp;lt;code&amp;gt;max_allowed_packet=200Mb&amp;lt;/code&amp;gt;&lt;br /&gt;
# Modify the following two lines in the application.properties file: &amp;lt;code&amp;gt;spring.servlet.multipart.max-file-size=200MB&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;spring.servlet.multipart.max-request-size=200MB&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Logs ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;logging.file.path=/'''home/user/openrimsre/log'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Recommended setting: '''logging.file.path= ./log/'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration it will be necessary to copy Client ID and Client secret to the application.properties&lt;br /&gt;
&lt;br /&gt;
==== OATH2 ====&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-id=client_id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-secret=client_secret&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''SMTP Configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; SMPT Outgoing email settings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.username=NRAemail@gmail.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.password=MyPassword&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow System Edits for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;##&amp;lt;/nowiki&amp;gt; Developer Mode Status&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variables.properties.edit=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow Cloning of Workflows for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;code&amp;gt;pharmadex.allow.process.import=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install OpenRIMS as a service ==&lt;br /&gt;
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.&lt;br /&gt;
&lt;br /&gt;
'''Linux'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d&lt;br /&gt;
&lt;br /&gt;
Here are detailed steps for Ubuntu 22.04:&lt;br /&gt;
&lt;br /&gt;
# Copy file .service to /etc/systemd/system: &amp;lt;code&amp;gt;sudo cp openrims.service /etc/systemd/system&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit file .service and change Username '''and''' Execstart path.&lt;br /&gt;
# Start the service: &amp;lt;code&amp;gt;systemctl enable openrims.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change Owner of the java application to your user: &amp;lt;code&amp;gt;sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; OR &amp;lt;code&amp;gt;sudo cdmod 500 pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference here is a sample service file:&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Description=Pharmadex 2 UAT version (madagascar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;After=pharmadex.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;User=ubuntu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SuccessExitStatus=143&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Install]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WantedBy=multi-user.target&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
'''For Windows'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services&lt;br /&gt;
&lt;br /&gt;
== Provide access from the Internet ==&lt;br /&gt;
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2.&lt;br /&gt;
&lt;br /&gt;
The example of virtual server configuration for Apache 2 is in the binary distributive folder named “Linux” on GitHub.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 22.04 and Apache2 here are the steps:&lt;br /&gt;
&lt;br /&gt;
# Copy pharmadex.conf to apache folder e.g. /etc/apache2/sites-available&lt;br /&gt;
# Enable the site a2ensite pharmadex&lt;br /&gt;
Here is another sample Apache conf file with https enabled by [https://www.digitalocean.com/community/tutorials/how-to-use-certbot-standalone-mode-to-retrieve-let-s-encrypt-ssl-certificates-on-ubuntu-20-04 Letsencrypt]:&amp;lt;blockquote&amp;gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
Redirect permanent / &amp;lt;nowiki&amp;gt;https://openrims.yourdomain.com/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
SSLEngine On&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile C:\Certbot\live\openrims.yourdomain.com\fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile C:\Certbot\live\openrims.yourdomain.com\privkey.pem&lt;br /&gt;
&lt;br /&gt;
SSLProtocol         all -SSLv3 -TLSv1 -TLSv1.1&lt;br /&gt;
&lt;br /&gt;
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&lt;br /&gt;
&lt;br /&gt;
SSLHonorCipherOrder on&lt;br /&gt;
&lt;br /&gt;
SSLCompression      off&lt;br /&gt;
&lt;br /&gt;
SSLSessionTickets   off&lt;br /&gt;
&lt;br /&gt;
SSLSessionCacheTimeout  300&lt;br /&gt;
&lt;br /&gt;
ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPass &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPassReverse &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Google Authentication ==&lt;br /&gt;
LINK: See [[OpenRIMS - Installation Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Special Configuration ==&lt;br /&gt;
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''&lt;br /&gt;
----[1] For current, available only to MSH staff&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=182</id>
		<title>OpenRIMS-RPM - Installation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=182"/>
		<updated>2024-07-11T17:40:10Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
This document describes deployment of OpenRIMS software on a default server.&lt;br /&gt;
&lt;br /&gt;
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.&lt;br /&gt;
&lt;br /&gt;
You should have the ability to install and configure programs and components/services in the selected operating system.&lt;br /&gt;
&lt;br /&gt;
Additionally you need experience on MySQL.&lt;br /&gt;
&lt;br /&gt;
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''&lt;br /&gt;
&lt;br /&gt;
== Overview of Server Requirements ==&lt;br /&gt;
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:&lt;br /&gt;
&lt;br /&gt;
=== Hardware Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Recommendation&lt;br /&gt;
|&lt;br /&gt;
|'''Initial Configuration and Testing Server'''&lt;br /&gt;
|'''Production Server'''&lt;br /&gt;
|-&lt;br /&gt;
|CPU&lt;br /&gt;
|1-2 cores&lt;br /&gt;
|8 cores&lt;br /&gt;
|-&lt;br /&gt;
|Memory&lt;br /&gt;
|At least 2 GB of free RAM&lt;br /&gt;
|At least 16 GB of free RAM&lt;br /&gt;
|-&lt;br /&gt;
|Harddrive&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|-&lt;br /&gt;
|Internet connection&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Operating System&lt;br /&gt;
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
Windows Server 2016 and above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Database:&lt;br /&gt;
|MySQL : Server 5.7 and Workbench 8.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Java:&lt;br /&gt;
|Oracle Java JDK 1.8&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
OpenJDK 1.8&lt;br /&gt;
&lt;br /&gt;
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|OpenRIMS application &amp;amp; database:&lt;br /&gt;
|OpenRIMS Java application binary&lt;br /&gt;
AND&lt;br /&gt;
&lt;br /&gt;
OpenRIMS demo database&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;nowiki&amp;gt;https://github.com/MSH/Pharmadex2/tree/main/database&amp;lt;/nowiki&amp;gt;[1])&lt;br /&gt;
&lt;br /&gt;
''(Please refer to the README.md file)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Google Oauth ID &amp;amp; Secret&lt;br /&gt;
|A Google Mail account for OAuth Login SSO&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== The OpenRIMS Installation Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Prepare to install ===&lt;br /&gt;
1.      Install the following using the respective vendor’s deployment manuals:&lt;br /&gt;
&lt;br /&gt;
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0&lt;br /&gt;
&lt;br /&gt;
1.2.   Java JDK 1.8&lt;br /&gt;
&lt;br /&gt;
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!&lt;br /&gt;
&lt;br /&gt;
''Ubuntu MySQL CLI hint (&amp;lt;code&amp;gt;CREATE DATABASE pdx2&amp;lt;/code&amp;gt;. And restore it: $ &amp;lt;code&amp;gt;mysql -u username -p pdx2 &amp;lt; DumpPdx2.sql&amp;lt;/code&amp;gt;)''&lt;br /&gt;
&lt;br /&gt;
3.      Copy the binary application &amp;lt;code&amp;gt;pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;application.properties&amp;lt;/code&amp;gt; to a dedicated user folder, e.g. /home/{username}/applications/openrims&lt;br /&gt;
&lt;br /&gt;
== Post-Installation OpenRIMS Configurations ==&lt;br /&gt;
&lt;br /&gt;
=== Local TCP/IP port ===&lt;br /&gt;
Adjust the application.properties file for initial configuration as described below.&lt;br /&gt;
&lt;br /&gt;
When initial configuration is concluded you should disable Variables Edit and Cloning of Workflows.&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.url = jdbc:mysql://localhost/'''openrimsre'''?useSSL=false&amp;amp;useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8&amp;amp;'''serverTimezone=Europe/Kiev'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.username = '''username'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.password = '''password'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Large Files Upload'''&lt;br /&gt;
&lt;br /&gt;
Large file uploads can be enabled but is not recommended. A separate repository should be identified like a Document Management System (DMS) e.g. Alfresco Community Edition or Google Drive.&lt;br /&gt;
&lt;br /&gt;
To enable large file upload the server administrator must (''example is max 200Mb file''):&lt;br /&gt;
&lt;br /&gt;
# Add following line to MySQL configuration file in the [mysqld] section: &amp;lt;code&amp;gt;max_allowed_packet=200Mb&amp;lt;/code&amp;gt;&lt;br /&gt;
# Modify the following two lines in the application.properties file: &amp;lt;code&amp;gt;spring.servlet.multipart.max-file-size=200MB&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;spring.servlet.multipart.max-request-size=200MB&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Logs ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;logging.file.path=/'''home/user/openrimsre/log'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Recommended setting: '''logging.file.path= ./log/'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration it will be necessary to copy Client ID and Client secret to the application.properties&lt;br /&gt;
&lt;br /&gt;
==== OATH2 ====&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-id=client_id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-secret=client_secret&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''SMTP Configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; SMPT Outgoing email settings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.username=NRAemail@gmail.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.password=MyPassword&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow System Edits for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;##&amp;lt;/nowiki&amp;gt; Developer Mode Status&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variables.properties.edit=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow Cloning of Workflows for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;code&amp;gt;pharmadex.allow.process.import=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install OpenRIMS as a service ==&lt;br /&gt;
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.&lt;br /&gt;
&lt;br /&gt;
'''Linux'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d&lt;br /&gt;
&lt;br /&gt;
Here are detailed steps for Ubuntu 22.04:&lt;br /&gt;
&lt;br /&gt;
# Copy file .service to /etc/systemd/system: &amp;lt;code&amp;gt;sudo cp openrims.service /etc/systemd/system&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit file .service and change Username '''and''' Execstart path.&lt;br /&gt;
# Start the service: &amp;lt;code&amp;gt;systemctl enable openrims.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change Owner of the java application to your user: &amp;lt;code&amp;gt;sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; OR &amp;lt;code&amp;gt;sudo cdmod 500 pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference here is a sample service file:&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Description=Pharmadex 2 UAT version (madagascar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;After=pharmadex.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;User=ubuntu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SuccessExitStatus=143&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Install]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WantedBy=multi-user.target&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
'''For Windows'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services&lt;br /&gt;
&lt;br /&gt;
== Provide access from the Internet ==&lt;br /&gt;
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2.&lt;br /&gt;
&lt;br /&gt;
The example of virtual server configuration for Apache 2 is in the binary distributive folder named “Linux” on GitHub.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 22.04 and Apache2 here are the steps:&lt;br /&gt;
&lt;br /&gt;
# Copy pharmadex.conf to apache folder e.g. /etc/apache2/sites-available&lt;br /&gt;
# Enable the site a2ensite pharmadex&lt;br /&gt;
Here is another sample Apache conf file with https enabled by [https://www.digitalocean.com/community/tutorials/how-to-use-certbot-standalone-mode-to-retrieve-let-s-encrypt-ssl-certificates-on-ubuntu-20-04 Letsencrypt]:&amp;lt;blockquote&amp;gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
Redirect permanent / &amp;lt;nowiki&amp;gt;https://openrims.yourdomain.com/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
SSLEngine On&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile C:\Certbot\live\openrims.yourdomain.com\fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile C:\Certbot\live\openrims.yourdomain.com\privkey.pem&lt;br /&gt;
&lt;br /&gt;
SSLProtocol         all -SSLv3 -TLSv1 -TLSv1.1&lt;br /&gt;
&lt;br /&gt;
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&lt;br /&gt;
&lt;br /&gt;
SSLHonorCipherOrder on&lt;br /&gt;
&lt;br /&gt;
SSLCompression      off&lt;br /&gt;
&lt;br /&gt;
SSLSessionTickets   off&lt;br /&gt;
&lt;br /&gt;
SSLSessionCacheTimeout  300&lt;br /&gt;
&lt;br /&gt;
ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPass &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPassReverse &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Google Authentication ==&lt;br /&gt;
LINK: See [[OpenRIMS - Installation Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Special Configuration ==&lt;br /&gt;
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''&lt;br /&gt;
----[1] For current, available only to MSH staff&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=181</id>
		<title>OpenRIMS-RPM - Upgrade Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=181"/>
		<updated>2024-06-28T16:53:55Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== '''Objective''' ===&lt;br /&gt;
A new release of OpenRIMS always contains changes in the software codes and, very often, in the database structure. To install a new release, it is necessary to replace the software codes and implement the database structure changes, if ones.&lt;br /&gt;
&lt;br /&gt;
The implementation of the database structure changes will keep all data, however, will allow the use of the new release of the software.&lt;br /&gt;
&lt;br /&gt;
Despite it being possible to use this feature for the production databases, it is recommended only for test and demo systems.&lt;br /&gt;
&lt;br /&gt;
Here are the steps to perform an upgrade from any version of OpenRIMS to latest version.&lt;br /&gt;
&lt;br /&gt;
# Connect to     destination server UI or CLI&lt;br /&gt;
# Backup Database&lt;br /&gt;
# Download the     new MySQL model file&lt;br /&gt;
# Stop the     OpenRIMS service&lt;br /&gt;
# Rename old     Application file&lt;br /&gt;
# Download the     new Application file (&amp;lt;nowiki&amp;gt;https://github.com/MSH/OpenRIMS/raw/main/bin/pharmadex2-0.0.1.jar&amp;lt;/nowiki&amp;gt;)&lt;br /&gt;
# Change     Permissions on the .jar file to make it executable: sudo chmod -x     pharmadex2-0.0.1.jar&lt;br /&gt;
# Use Workbench     to upgrade db structure based on the model - see below&lt;br /&gt;
# Start the     OpenRIMS service&lt;br /&gt;
&lt;br /&gt;
=== '''Tool''' ===&lt;br /&gt;
The tool is the latest version of MySQL Workbench.&lt;br /&gt;
&lt;br /&gt;
For current, the latest stable release of the database is in pdx2demo.ddanet.org. To upgrade the database in any other server, or, even, in the localhost it is possible to use the feature “Model – Synchronize with any source” (&amp;lt;nowiki&amp;gt;https://dev.mysql.com/doc/workbench/en/wb-database-synchronization.html&amp;lt;/nowiki&amp;gt;) provided by the MySQL Workbench.&lt;br /&gt;
&lt;br /&gt;
This feature:&lt;br /&gt;
&lt;br /&gt;
# reads the latest and the current database structures,&lt;br /&gt;
# compares them&lt;br /&gt;
# creates a script to upgrade the current database to the latest database structure&lt;br /&gt;
# executes this script&lt;br /&gt;
&lt;br /&gt;
The result is the equal data structures for the latest and the current database. The data is still the same as was before.&lt;br /&gt;
&lt;br /&gt;
=== '''Pre-requisites''' ===&lt;br /&gt;
You should have full access rights to your database and add the connection to the latest database depicted below. Ask for a password by email to alex.kurasoff@gmail.com.&lt;br /&gt;
&lt;br /&gt;
Figure 1. The connection to the latest database&lt;br /&gt;
&lt;br /&gt;
=== '''Process steps''' ===&lt;br /&gt;
Suppose you need to update the database structure of a database on the localhost.&lt;br /&gt;
&lt;br /&gt;
Figure 2. Create a '''new''' model&lt;br /&gt;
&lt;br /&gt;
Figure 3. Run the feature&lt;br /&gt;
&lt;br /&gt;
Figure 4. The representation of the feature is a &amp;quot;wizard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Figure 5. Tap the radio buttons&lt;br /&gt;
&lt;br /&gt;
Figure 6. The latest database is on pdx2demo.ddanet.org. It is the source of the changes&lt;br /&gt;
&lt;br /&gt;
Figure 7. Suppose the database going to be updated is in the localhost. It is the target of the changes&lt;br /&gt;
&lt;br /&gt;
Figure 8. Extract the list of all sources and all target databases.&lt;br /&gt;
&lt;br /&gt;
Figure 9. Select the source database. The target database is at the bottom of the screen. By default, the names of the target and the source should be the same&lt;br /&gt;
&lt;br /&gt;
Figure 10. Compare the source and the target&lt;br /&gt;
&lt;br /&gt;
Figure 11. Revise the changes.&lt;br /&gt;
&lt;br /&gt;
Figure 12. The result DDA SQL script. There are no changes&lt;br /&gt;
&lt;br /&gt;
=== '''Linux particularities''' ===&lt;br /&gt;
The MySQL database usage in Windows and Linux servers is slightly different. In the Linux server, the names of tables are cases sensitive, on Windows – no. There is any problem if the source server is under Linux, and the target server is under Windows. Otherwise, the tables SPRING_SESSION and SPRING_SESSION attributes should be ignored while synchronization. There are special tables that are in use by third-party software.&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=180</id>
		<title>OpenRIMS-RPM - Upgrade Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=180"/>
		<updated>2024-06-28T16:52:45Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=179</id>
		<title>OpenPV - Spontaneous Form Creation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=179"/>
		<updated>2024-06-23T02:00:58Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following script will create a standard Spontaneous Reporting form in OpenRIMS-PV.&amp;lt;blockquote&amp;gt;/*The following script will create a standard Spontaneous Reporting form in OpenRIMS-PV.*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/*DATASET*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO dataset (DatasetName, active, initialiseprocess, RulesProcess, help, created, lastupdated, contexttype_id, createdby_id, updatedby_Id, issystem)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Spontaneous Report 2', 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 'Suspected adverse drug reaction (ADR) online reporting form', now(), now(), 4, 1, 1, 1);&lt;br /&gt;
&lt;br /&gt;
set @dsid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/*CATEGORY Patient Information*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Patient Information', 1, @dsid, 'Patient Information', 'Please enter some information about the person who had the adverse reaction.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Initials&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 5, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Initials', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '29CD2157-8FB6-4883-A4E6-A4B9EDE6B36B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, @dscid, @deid, 0, 0, 'Initials of Patient', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s initials here OR their ID number and type below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '5A2E89A9-8240-4665-967D-0C655CF281B7');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (2, @dscid, @deid, 1, 0, 'Identification Number', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s ID number OR enter their initials above..');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Type&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('National Identity', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Type', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E3CDDEB3-E129-4161-AC91-4DD91CC8AD4B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (3, @dscid, @deid, 1, 0, 'Identification Type', 'If you entered a patient ID number, specify the ID type here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Date of Birth&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Date of Birth', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '0D704069-5C50-4085-8FE1-355BB64EF196');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (4, @dscid, @deid, 1, 0, 'Patient Date of Birth', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s date of birth here OR enter their age below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 140.00, 0.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'D314C438-5ABA-4ED2-855D-1A5B22B5A301');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (5, @dscid, @deid, 1, 0, 'Age', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here OR enter their date of birth above.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Years', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Months', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weeks', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Days', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age Unit', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '80C219DC-238C-487E-A3D5-8919ABA674B1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (6, @dscid, @deid, 1, 0, 'Age Unit of Measure', 'Enter weeks, months, or years for the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Weight (kg)&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 1, 159.90, 1.10, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weight  (kg)', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '985BD25D-54E7-4A24-8636-6DBC0F9C7B96');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (7, @dscid, @deid, 1, 0, 'Patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s weight (kg)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Sex&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Male', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Female', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Sex', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E061D363-534E-4EA4-B6E5-F1C531931B12');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (8, @dscid, @deid, 0, 0, 'Sex', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Ethnic Group&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Asian', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('East Asian', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('South Asian', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Southeast Asian', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Black', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('White', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Middle Eastern', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Ethnic Group', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'DF6717EF-A674-46DD-B738-859355ECA9A1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (9, @dscid, @deid, 1, 0, 'Ethnic Group of Patient', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/*CATEGORY Product Information*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', 2, @dsid, 'Product Information', 'Please enter information about the product you suspect caused the reaction and about other products taken.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product Information Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '712CA632-0CD0-4418-9176-FB0B95AEE8A1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Name of product', 'Name of product.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Product Name', 'Enter the brand or generic name');&lt;br /&gt;
&lt;br /&gt;
-- Product Suspected&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Suspected', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Is the product suspected?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug strength&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Strength', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Drug Strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug strength unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams (mg)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams/milliliters (mg/ml)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('grams (gm)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('kilograms (kg)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('micrograms (mcg)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliters (ml)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('liters (l)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliequivalents (meq)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('percent (%)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drops (gtt)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug strength unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Dose Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Dose number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Dose Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablet(s)', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('capsule(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drop(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('teaspoon(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablespoon(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliter(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('suppository(ies)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('injection(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('puff(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('inhalation(s)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('patch(es)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Unit of dosage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug route of administration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('By mouth', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Taken under the tongue', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied to a surface, usually skin', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Inhalation', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied as a medicated patch to skin', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Given into/under the skin', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a vein', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a muscle', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the ear', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the eye', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Rectal', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Vaginal', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug route of administration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Drug route of administration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug Start Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Start Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 8, 'Date drug usage started', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug End Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug End Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 9, 'Date drug usage ended', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 10, 'Duration of usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('801=Year', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('802=Month', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('803=Week', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('804=Day', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('805=Hour', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('806=Minute', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 11, 'Unit of duration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug Indication&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 250, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Indication', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Indication for drug usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Product Frequency&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Frequency', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Frequency of product usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Product Batch Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 25, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Batch Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Product batch number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Actions taken with product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product withdrawn', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose reduced', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose increased', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose not changed', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not applicable', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Actions taken with product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 13, 'Actions taken with product', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Product challenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product challenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 14, 'Was there a challenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Product rechallenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Didn&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t restart', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product rechallenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 15, 'Was there a rechallenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/*CATEGORY Reaction and Treatment*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction and Treatment', 3, @dsid, 'Reaction and Treatment', 'Enter information about what happened and how it was treated.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Description of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Description of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'ACD938A4-76D1-44CE-A070-2B8DF0FE9E0F');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (84, @dscid, @deid, 0, 0, 'Description of reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction known start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F5EEB382-D4A5-41A1-A447-37D5ECA50B99');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (85, @dscid, @deid, 0, 0, 'Start date of reaction', 'Enter the start date of the reaction OR enter the estimated start date in the next field.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction estimated start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction estimated start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '67F2C8CA-503B-498C-9B7E-561BAE4DFA52');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (90, @dscid, @deid, 0, 0, 'Estimated start date of reaction', 'If you don&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t know the exact start date of the reaction, enter the estimated start date here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction serious details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Resulted in death', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is life-threatening', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Requires inpatient hospitalization or prolongation of existing hospitalization', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Results in persistent or significant disability/incapacity (as per reporter&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s opinion)', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is a congenital anomaly/birth defect', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other medically important condition', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction serious details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '302C07C9-B0E0-46AB-9EF8-5D5C2F756BF1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 0, 0, 'Did any of these reactions happen?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '3A84016D-9A58-464F-A316-027A095291CE');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Was treatment given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '24DE20BE-AB13-487B-B679-D62D6FEE8814');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 0, 0, 'What treatment was given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Outcome of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovering/resolving', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not recovered/not resolved', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved with permanent complications', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Fatal', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Outcome of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '976F6C53-78F2-4007-8F39-54057E554EEB');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (95, @dscid, @deid, 0, 0, 'What was the outcome of the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of recovery&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of recovery', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F977C2F8-C7DD-4AFE-BCAA-1C06BD54D155');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'What was the date of recovery from the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of death&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of death', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '8B15C037-9C92-4AD4-A8F4-6C4042D40D9D');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (97, @dscid, @deid, 0, 0, 'Enter date if patient died from the reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction other relevant info&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction other relevant info', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '7BBEC54B-65C3-4BA6-B5A7-83C3C473F803');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 0, 0, 'Other relevant information', 'For example, does the patient have other medical problems?');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/*CATEGORY Test Results*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', 4, @dsid, 'Test Results', 'Enter information about any tests done for the reaction, along with the results.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Results Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '12D7089D-1603-4309-99DE-60F20F9A005E');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Test Results', 'Test Results');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Date the test was conducted', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Test Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Name', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Name of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Test Result&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Result', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Result of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Test Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 35, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Low Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Low Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Lower limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- High Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('High Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Upper limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- More Information&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('More Information', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Any additional information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/*CATEGORY Reporter Information*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Information', 5, @dsid, 'Reporter Information', 'Enter information about the person reporting the reaction.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 60, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Name', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '926A07E1-8B83-41CA-8949-739717924AD9');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 1, 0, 'Name or initials of person reporting information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Telephone Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Telephone Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '1AC02BD6-5C24-4A37-9742-C6B868ED985D');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact telephone number for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter E-mail Address&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter E-mail Address', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'FFDA770F-DADE-4F6E-B39A-D5E929AEDE2E');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact e-mail address for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Profession&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Physician', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Pharmacist', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Consumer or other non-health professional', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other Health Professional', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Lawyer', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Profession', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '79ABA1EC-3979-4BA2-80AF-1F817C8243B9');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 1, 0, 'Profession of reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Report Reference Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Report Reference Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'C2EDD7A9-8031-4836-99A0-32C84D99A0AC');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'Report reference number (if any)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Place of Practice&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Place of Practice', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'A517AAE8-76BD-41F0-8FEE-BD45FCE4EBC8');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 1, 0, 'Reporter place of practise', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Keep Reporter Confidential&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Keep Reporter Confidential', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '63AE2D15-029B-4D7C-87BA-16C52A67A909');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (100, @dscid, @deid, 0, 0, 'Keep reporter confidential?', 'Do you want your identity kept confidential except to be contacted by the national medical regulatory authority or the World Health Organization if they need additional information?');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/*SET ORDERING*/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
SELECT ds.DatasetName, dc.DatasetCategoryName, de.ElementName FROM Dataset ds&lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategory dc ON ds.Id = dc.Dataset_Id&lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategoryElement dce ON dc.Id = dce.DatasetCategory_Id&lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetElement de ON dce.DatasetElement_Id = de.Id&lt;br /&gt;
&lt;br /&gt;
where ds.Id = @dsid&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=178</id>
		<title>OpenPV - Spontaneous Form Creation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=178"/>
		<updated>2024-06-23T01:53:33Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following script will create a standard Spontaneous Reporting form in OpenRIMS-PV.&amp;lt;blockquote&amp;gt;/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/DATASET/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO dataset (DatasetName, active, initialiseprocess, RulesProcess, help, created, lastupdated, contexttype_id, createdby_id, updatedby_Id, issystem)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Spontaneous Report 2', 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 'Suspected adverse drug reaction (ADR) online reporting form', now(), now(), 4, 1, 1, 1);&lt;br /&gt;
&lt;br /&gt;
set @dsid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/CATEGORY Patient Information/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Patient Information', 1, @dsid, 'Patient Information', 'Please enter some information about the person who had the adverse reaction.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Initials&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 5, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Initials', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '29CD2157-8FB6-4883-A4E6-A4B9EDE6B36B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, @dscid, @deid, 0, 0, 'Initials of Patient', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s initials here OR their ID number and type below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '5A2E89A9-8240-4665-967D-0C655CF281B7');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (2, @dscid, @deid, 1, 0, 'Identification Number', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s ID number OR enter their initials above..');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Type&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('National Identity', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Type', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E3CDDEB3-E129-4161-AC91-4DD91CC8AD4B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (3, @dscid, @deid, 1, 0, 'Identification Type', 'If you entered a patient ID number, specify the ID type here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Date of Birth&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Date of Birth', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '0D704069-5C50-4085-8FE1-355BB64EF196');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (4, @dscid, @deid, 1, 0, 'Patient Date of Birth', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s date of birth here OR enter their age below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 140.00, 0.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'D314C438-5ABA-4ED2-855D-1A5B22B5A301');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (5, @dscid, @deid, 1, 0, 'Age', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here OR enter their date of birth above.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Years', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Months', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weeks', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Days', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age Unit', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '80C219DC-238C-487E-A3D5-8919ABA674B1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (6, @dscid, @deid, 1, 0, 'Age Unit of Measure', 'Enter weeks, months, or years for the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Weight (kg)&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 1, 159.90, 1.10, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weight  (kg)', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '985BD25D-54E7-4A24-8636-6DBC0F9C7B96');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (7, @dscid, @deid, 1, 0, 'Patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s weight (kg)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Sex&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Male', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Female', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Sex', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E061D363-534E-4EA4-B6E5-F1C531931B12');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (8, @dscid, @deid, 0, 0, 'Sex', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Ethnic Group&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Asian', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('East Asian', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('South Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Southeast Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Black', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('White', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Middle Eastern', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Ethnic Group', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'DF6717EF-A674-46DD-B738-859355ECA9A1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (9, @dscid, @deid, 1, 0, 'Ethnic Group of Patient', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/CATEGORY Product Information/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', 2, @dsid, 'Product Information', 'Please enter information about the product you suspect caused the reaction and about other products taken.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product Information Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '712CA632-0CD0-4418-9176-FB0B95AEE8A1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Name of product', 'Name of product.'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Product Name', 'Enter the brand or generic name'); &lt;br /&gt;
&lt;br /&gt;
-- Product Suspected&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Suspected', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Is the product suspected?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Strength', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Drug Strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams (mg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams/milliliters (mg/ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('grams (gm)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('kilograms (kg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('micrograms (mcg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliters (ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('liters (l)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliequivalents (meq)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('percent (%)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drops (gtt)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug strength unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Dose Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Dose number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Dose Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablet(s)', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('capsule(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drop(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('teaspoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablespoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliter(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('suppository(ies)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('injection(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('puff(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('inhalation(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('patch(es)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Unit of dosage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug route of administration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('By mouth', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Taken under the tongue', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied to a surface, usually skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Inhalation', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied as a medicated patch to skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Given into/under the skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a vein', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a muscle', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the ear', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the eye', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Rectal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Vaginal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug route of administration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Drug route of administration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Start Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Start Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 8, 'Date drug usage started', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug End Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug End Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 9, 'Date drug usage ended', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 10, 'Duration of usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('801=Year', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('802=Month', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('803=Week', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('804=Day', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('805=Hour', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('806=Minute', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 11, 'Unit of duration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Indication&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 250, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Indication', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Indication for drug usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Frequency&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Frequency', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Frequency of product usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Batch Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 25, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Batch Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Product batch number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Actions taken with product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product withdrawn', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose reduced', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose increased', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose not changed', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not applicable', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Actions taken with product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 13, 'Actions taken with product', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product challenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product challenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 14, 'Was there a challenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product rechallenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Didn&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t restart', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product rechallenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 15, 'Was there a rechallenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/CATEGORY Reaction and Treatment/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction and Treatment', 3, @dsid, 'Reaction and Treatment', 'Enter information about what happened and how it was treated.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Description of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Description of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'ACD938A4-76D1-44CE-A070-2B8DF0FE9E0F'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (84, @dscid, @deid, 0, 0, 'Description of reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction known start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F5EEB382-D4A5-41A1-A447-37D5ECA50B99'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (85, @dscid, @deid, 0, 0, 'Start date of reaction', 'Enter the start date of the reaction OR enter the estimated start date in the next field.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction estimated start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction estimated start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '67F2C8CA-503B-498C-9B7E-561BAE4DFA52');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (90, @dscid, @deid, 0, 0, 'Estimated start date of reaction', 'If you don&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t know the exact start date of the reaction, enter the estimated start date here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction serious details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Resulted in death', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is life-threatening', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Requires inpatient hospitalization or prolongation of existing hospitalization', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Results in persistent or significant disability/incapacity (as per reporter&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s opinion)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is a congenital anomaly/birth defect', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other medically important condition', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction serious details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '302C07C9-B0E0-46AB-9EF8-5D5C2F756BF1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 0, 0, 'Did any of these reactions happen?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '3A84016D-9A58-464F-A316-027A095291CE'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Was treatment given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '24DE20BE-AB13-487B-B679-D62D6FEE8814'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 0, 0, 'What treatment was given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Outcome of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovering/resolving', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not recovered/not resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved with permanent complications', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Fatal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Outcome of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '976F6C53-78F2-4007-8F39-54057E554EEB'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (95, @dscid, @deid, 0, 0, 'What was the outcome of the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of recovery&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of recovery', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F977C2F8-C7DD-4AFE-BCAA-1C06BD54D155'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'What was the date of recovery from the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of death&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of death', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '8B15C037-9C92-4AD4-A8F4-6C4042D40D9D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (97, @dscid, @deid, 0, 0, 'Enter date if patient died from the reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction other relevant info&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction other relevant info', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '7BBEC54B-65C3-4BA6-B5A7-83C3C473F803'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 0, 0, 'Other relevant information', 'For example, does the patient have other medical problems?');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/CATEGORY Test Results/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', 4, @dsid, 'Test Results', 'Enter information about any tests done for the reaction, along with the results.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Results Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '12D7089D-1603-4309-99DE-60F20F9A005E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Test Results', 'Test Results'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Date the test was conducted', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Name', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Name of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Result&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Result', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Result of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 35, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Low Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Low Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Lower limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- High Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('High Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Upper limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- More Information&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('More Information', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Any additional information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/CATEGORY Reporter Information/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Information', 5, @dsid, 'Reporter Information', 'Enter information about the person reporting the reaction.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 60, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Name', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '926A07E1-8B83-41CA-8949-739717924AD9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 1, 0, 'Name or initials of person reporting information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Telephone Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Telephone Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '1AC02BD6-5C24-4A37-9742-C6B868ED985D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact telephone number for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter E-mail Address&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter E-mail Address', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'FFDA770F-DADE-4F6E-B39A-D5E929AEDE2E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact e-mail address for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Profession&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Physician', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Pharmacist', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Consumer or other non-health professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other Health Professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Lawyer', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Profession', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '79ABA1EC-3979-4BA2-80AF-1F817C8243B9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 1, 0, 'Profession of reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Report Reference Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Report Reference Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'C2EDD7A9-8031-4836-99A0-32C84D99A0AC'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'Report reference number (if any)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Place of Practice&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Place of Practice', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'A517AAE8-76BD-41F0-8FEE-BD45FCE4EBC8');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 1, 0, 'Reporter place of practise', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Keep Reporter Confidential&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Keep Reporter Confidential', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '63AE2D15-029B-4D7C-87BA-16C52A67A909'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (100, @dscid, @deid, 0, 0, 'Keep reporter confidential?', 'Do you want your identity kept confidential except to be contacted by the national medical regulatory authority or the World Health Organization if they need additional information?'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/SET ORDERING/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
SELECT ds.DatasetName, dc.DatasetCategoryName, de.ElementName FROM Dataset ds&lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategory dc ON ds.Id = dc.Dataset_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategoryElement dce ON dc.Id = dce.DatasetCategory_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetElement de ON dce.DatasetElement_Id = de.Id &lt;br /&gt;
&lt;br /&gt;
where ds.Id = @dsid&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=177</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=177"/>
		<updated>2024-06-23T01:48:12Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Please send an email to info@openrims.org to download the required files.&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;wget zip files for each app and api (from openrims.org/GitHub)&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/app using mc&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/api using mc&lt;br /&gt;
&lt;br /&gt;
Make dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x PViMS.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
A good connection string looks like this:&lt;br /&gt;
 &amp;quot;ConnectionString&amp;quot;: &amp;quot;Server=localhost,3306;Database=openrims-pv;User Id=pvuser; Password=P@55w0rd;Pooling=False;&amp;quot;&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspvm.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / https://'''subdomain'''.openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        Redirect permanent / [https://subdomain-api https://'''subdomain-api'''].openrims.org/&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
=== '''Post SSL Configuration''' ===&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=176</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=176"/>
		<updated>2024-06-23T00:26:02Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Please send an email to info@openrims.org to download the required files.&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;wget zip files for each app and api (from openrims.org/GitHub)&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/app using mc&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/api using mc&lt;br /&gt;
&lt;br /&gt;
Make dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x PViMS.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
A good connection string looks like this:&lt;br /&gt;
 &amp;quot;ConnectionString&amp;quot;: &amp;quot;Server=localhost,3306;Database=openrims-pv;User Id=pvuser; Password=P@55w0rd;Pooling=False;&amp;quot;&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspvm.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/api&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
=== '''Post SSL Configuration''' ===&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=175</id>
		<title>OpenPV - Spontaneous Form Creation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=175"/>
		<updated>2024-05-23T18:25:31Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following script will create a standard Spontaneous Reporting form in OpenRIMS-PV.&amp;lt;blockquote&amp;gt;/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/DATASET/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO dataset (DatasetName, active, initialiseprocess, RulesProcess, help, created, lastupdated, contexttype_id, createdby_id, updatedby_Id, issystem)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Spontaneous Report 2', 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 'Suspected adverse drug reaction (ADR) online reporting form', now(), now(), 4, 1, 1, 1);&lt;br /&gt;
&lt;br /&gt;
set @dsid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
/CATEGORY Patient Information/&lt;br /&gt;
&lt;br /&gt;
/**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Patient Information', 1, @dsid, 'Patient Information', 'Please enter some information about the person who had the adverse reaction.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Initials&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 5, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Initials', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '29CD2157-8FB6-4883-A4E6-A4B9EDE6B36B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, @dscid, @deid, 0, 0, 'Initials of Patient', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s initials here OR their ID number and type below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '5A2E89A9-8240-4665-967D-0C655CF281B7');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (2, @dscid, @deid, 1, 0, 'Identification Number', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s ID number OR enter their initials above..');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Type&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('National Identity', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Type', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E3CDDEB3-E129-4161-AC91-4DD91CC8AD4B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (3, @dscid, @deid, 1, 0, 'Identification Type', 'If you entered a patient ID number, specify the ID type here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Date of Birth&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Date of Birth', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '0D704069-5C50-4085-8FE1-355BB64EF196');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (4, @dscid, @deid, 1, 0, 'Patient Date of Birth', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s date of birth here OR enter their age below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 140.00, 0.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'D314C438-5ABA-4ED2-855D-1A5B22B5A301');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (5, @dscid, @deid, 1, 0, 'Age', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here OR enter their date of birth above.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Years', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Months', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weeks', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Days', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age Unit', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '80C219DC-238C-487E-A3D5-8919ABA674B1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (6, @dscid, @deid, 1, 0, 'Age Unit of Measure', 'Enter weeks, months, or years for the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Weight (kg)&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 1, 159.90, 1.10, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weight  (kg)', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '985BD25D-54E7-4A24-8636-6DBC0F9C7B96');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (7, @dscid, @deid, 1, 0, 'Patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s weight (kg)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Sex&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Male', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Female', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Sex', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E061D363-534E-4EA4-B6E5-F1C531931B12');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (8, @dscid, @deid, 0, 0, 'Sex', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Ethnic Group&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Asian', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('East Asian', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('South Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Southeast Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Black', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('White', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Middle Eastern', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Ethnic Group', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'DF6717EF-A674-46DD-B738-859355ECA9A1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (9, @dscid, @deid, 1, 0, 'Ethnic Group of Patient', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Product Information&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', 2, @dsid, 'Product Information', 'Please enter information about the product you suspect caused the reaction and about other products taken.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product Information Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '712CA632-0CD0-4418-9176-FB0B95AEE8A1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Name of product', 'Name of product.'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Product Name', 'Enter the brand or generic name'); &lt;br /&gt;
&lt;br /&gt;
-- Product Suspected&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Suspected', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Is the product suspected?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Strength', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Drug Strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams (mg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams/milliliters (mg/ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('grams (gm)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('kilograms (kg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('micrograms (mcg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliters (ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('liters (l)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliequivalents (meq)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('percent (%)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drops (gtt)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug strength unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Dose Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Dose number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Dose Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablet(s)', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('capsule(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drop(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('teaspoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablespoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliter(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('suppository(ies)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('injection(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('puff(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('inhalation(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('patch(es)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Unit of dosage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug route of administration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('By mouth', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Taken under the tongue', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied to a surface, usually skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Inhalation', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied as a medicated patch to skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Given into/under the skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a vein', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a muscle', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the ear', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the eye', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Rectal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Vaginal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug route of administration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Drug route of administration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Start Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Start Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 8, 'Date drug usage started', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug End Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug End Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 9, 'Date drug usage ended', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 10, 'Duration of usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('801=Year', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('802=Month', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('803=Week', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('804=Day', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('805=Hour', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('806=Minute', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 11, 'Unit of duration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Indication&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 250, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Indication', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Indication for drug usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Frequency&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Frequency', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Frequency of product usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Batch Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 25, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Batch Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Product batch number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Actions taken with product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product withdrawn', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose reduced', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose increased', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose not changed', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not applicable', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Actions taken with product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 13, 'Actions taken with product', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product challenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product challenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 14, 'Was there a challenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product rechallenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Didn&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t restart', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product rechallenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 15, 'Was there a rechallenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Reaction and Treatment&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction and Treatment', 3, @dsid, 'Reaction and Treatment', 'Enter information about what happened and how it was treated.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Description of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Description of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'ACD938A4-76D1-44CE-A070-2B8DF0FE9E0F'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (84, @dscid, @deid, 0, 0, 'Description of reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction known start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F5EEB382-D4A5-41A1-A447-37D5ECA50B99'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (85, @dscid, @deid, 0, 0, 'Start date of reaction', 'Enter the start date of the reaction OR enter the estimated start date in the next field.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction estimated start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction estimated start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '67F2C8CA-503B-498C-9B7E-561BAE4DFA52');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (90, @dscid, @deid, 0, 0, 'Estimated start date of reaction', 'If you don&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t know the exact start date of the reaction, enter the estimated start date here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction serious details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Resulted in death', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is life-threatening', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Requires inpatient hospitalization or prolongation of existing hospitalization', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Results in persistent or significant disability/incapacity (as per reporter&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s opinion)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is a congenital anomaly/birth defect', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other medically important condition', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction serious details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '302C07C9-B0E0-46AB-9EF8-5D5C2F756BF1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 0, 0, 'Did any of these reactions happen?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '3A84016D-9A58-464F-A316-027A095291CE'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Was treatment given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '24DE20BE-AB13-487B-B679-D62D6FEE8814'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 0, 0, 'What treatment was given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Outcome of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovering/resolving', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not recovered/not resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved with permanent complications', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Fatal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Outcome of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '976F6C53-78F2-4007-8F39-54057E554EEB'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (95, @dscid, @deid, 0, 0, 'What was the outcome of the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of recovery&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of recovery', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F977C2F8-C7DD-4AFE-BCAA-1C06BD54D155'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'What was the date of recovery from the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of death&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of death', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '8B15C037-9C92-4AD4-A8F4-6C4042D40D9D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (97, @dscid, @deid, 0, 0, 'Enter date if patient died from the reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction other relevant info&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction other relevant info', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '7BBEC54B-65C3-4BA6-B5A7-83C3C473F803'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 0, 0, 'Other relevant information', 'For example, does the patient have other medical problems?');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Test Results&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', 4, @dsid, 'Test Results', 'Enter information about any tests done for the reaction, along with the results.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Results Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '12D7089D-1603-4309-99DE-60F20F9A005E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Test Results', 'Test Results'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Date the test was conducted', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Name', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Name of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Result&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Result', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Result of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 35, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Low Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Low Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Lower limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- High Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('High Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Upper limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- More Information&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('More Information', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Any additional information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Reporter Information&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Information', 5, @dsid, 'Reporter Information', 'Enter information about the person reporting the reaction.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 60, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Name', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '926A07E1-8B83-41CA-8949-739717924AD9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 1, 0, 'Name or initials of person reporting information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Telephone Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Telephone Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '1AC02BD6-5C24-4A37-9742-C6B868ED985D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact telephone number for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter E-mail Address&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter E-mail Address', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'FFDA770F-DADE-4F6E-B39A-D5E929AEDE2E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact e-mail address for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Profession&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Physician', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Pharmacist', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Consumer or other non-health professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other Health Professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Lawyer', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Profession', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '79ABA1EC-3979-4BA2-80AF-1F817C8243B9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 1, 0, 'Profession of reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Report Reference Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Report Reference Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'C2EDD7A9-8031-4836-99A0-32C84D99A0AC'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'Report reference number (if any)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Place of Practice&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Place of Practice', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'A517AAE8-76BD-41F0-8FEE-BD45FCE4EBC8');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 1, 0, 'Reporter place of practise', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Keep Reporter Confidential&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Keep Reporter Confidential', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '63AE2D15-029B-4D7C-87BA-16C52A67A909'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (100, @dscid, @deid, 0, 0, 'Keep reporter confidential?', 'Do you want your identity kept confidential except to be contacted by the national medical regulatory authority or the World Health Organization if they need additional information?'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
SET ORDERING&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
SELECT ds.DatasetName, dc.DatasetCategoryName, de.ElementName FROM Dataset ds&lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategory dc ON ds.Id = dc.Dataset_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategoryElement dce ON dc.Id = dce.DatasetCategory_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetElement de ON dce.DatasetElement_Id = de.Id &lt;br /&gt;
&lt;br /&gt;
where ds.Id = @dsid&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=174</id>
		<title>OpenPV - Spontaneous Form Creation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=174"/>
		<updated>2024-05-23T18:24:51Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following script will create a standard Spontaneous Reporting form in OpenRIMS-PV.&amp;lt;blockquote&amp;gt;/**************************************************&lt;br /&gt;
&lt;br /&gt;
DATASET&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO dataset (DatasetName, active, initialiseprocess, RulesProcess, help, created, lastupdated, contexttype_id, createdby_id, updatedby_Id, issystem)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Spontaneous Report 2', 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 'Suspected adverse drug reaction (ADR) online reporting form', now(), now(), 4, 1, 1, 1);&lt;br /&gt;
&lt;br /&gt;
set @dsid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Patient Information/&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Patient Information', 1, @dsid, 'Patient Information', 'Please enter some information about the person who had the adverse reaction.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Initials&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 5, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Initials', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '29CD2157-8FB6-4883-A4E6-A4B9EDE6B36B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, @dscid, @deid, 0, 0, 'Initials of Patient', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s initials here OR their ID number and type below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '5A2E89A9-8240-4665-967D-0C655CF281B7');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (2, @dscid, @deid, 1, 0, 'Identification Number', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s ID number OR enter their initials above..');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Type&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('National Identity', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Type', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E3CDDEB3-E129-4161-AC91-4DD91CC8AD4B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (3, @dscid, @deid, 1, 0, 'Identification Type', 'If you entered a patient ID number, specify the ID type here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Date of Birth&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Date of Birth', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '0D704069-5C50-4085-8FE1-355BB64EF196');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (4, @dscid, @deid, 1, 0, 'Patient Date of Birth', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s date of birth here OR enter their age below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 140.00, 0.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'D314C438-5ABA-4ED2-855D-1A5B22B5A301');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (5, @dscid, @deid, 1, 0, 'Age', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here OR enter their date of birth above.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Years', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Months', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weeks', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Days', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age Unit', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '80C219DC-238C-487E-A3D5-8919ABA674B1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (6, @dscid, @deid, 1, 0, 'Age Unit of Measure', 'Enter weeks, months, or years for the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Weight (kg)&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 1, 159.90, 1.10, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weight  (kg)', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '985BD25D-54E7-4A24-8636-6DBC0F9C7B96');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (7, @dscid, @deid, 1, 0, 'Patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s weight (kg)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Sex&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Male', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Female', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Sex', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E061D363-534E-4EA4-B6E5-F1C531931B12');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (8, @dscid, @deid, 0, 0, 'Sex', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Ethnic Group&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Asian', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('East Asian', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('South Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Southeast Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Black', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('White', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Middle Eastern', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Ethnic Group', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'DF6717EF-A674-46DD-B738-859355ECA9A1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (9, @dscid, @deid, 1, 0, 'Ethnic Group of Patient', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Product Information&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', 2, @dsid, 'Product Information', 'Please enter information about the product you suspect caused the reaction and about other products taken.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product Information Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '712CA632-0CD0-4418-9176-FB0B95AEE8A1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Name of product', 'Name of product.'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Product Name', 'Enter the brand or generic name'); &lt;br /&gt;
&lt;br /&gt;
-- Product Suspected&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Suspected', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Is the product suspected?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Strength', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Drug Strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams (mg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams/milliliters (mg/ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('grams (gm)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('kilograms (kg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('micrograms (mcg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliters (ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('liters (l)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliequivalents (meq)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('percent (%)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drops (gtt)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug strength unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Dose Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Dose number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Dose Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablet(s)', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('capsule(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drop(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('teaspoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablespoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliter(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('suppository(ies)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('injection(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('puff(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('inhalation(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('patch(es)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Unit of dosage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug route of administration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('By mouth', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Taken under the tongue', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied to a surface, usually skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Inhalation', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied as a medicated patch to skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Given into/under the skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a vein', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a muscle', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the ear', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the eye', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Rectal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Vaginal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug route of administration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Drug route of administration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Start Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Start Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 8, 'Date drug usage started', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug End Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug End Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 9, 'Date drug usage ended', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 10, 'Duration of usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('801=Year', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('802=Month', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('803=Week', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('804=Day', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('805=Hour', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('806=Minute', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 11, 'Unit of duration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Indication&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 250, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Indication', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Indication for drug usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Frequency&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Frequency', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Frequency of product usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Batch Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 25, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Batch Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Product batch number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Actions taken with product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product withdrawn', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose reduced', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose increased', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose not changed', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not applicable', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Actions taken with product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 13, 'Actions taken with product', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product challenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product challenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 14, 'Was there a challenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product rechallenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Didn&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t restart', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product rechallenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 15, 'Was there a rechallenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Reaction and Treatment&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction and Treatment', 3, @dsid, 'Reaction and Treatment', 'Enter information about what happened and how it was treated.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Description of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Description of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'ACD938A4-76D1-44CE-A070-2B8DF0FE9E0F'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (84, @dscid, @deid, 0, 0, 'Description of reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction known start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F5EEB382-D4A5-41A1-A447-37D5ECA50B99'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (85, @dscid, @deid, 0, 0, 'Start date of reaction', 'Enter the start date of the reaction OR enter the estimated start date in the next field.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction estimated start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction estimated start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '67F2C8CA-503B-498C-9B7E-561BAE4DFA52');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (90, @dscid, @deid, 0, 0, 'Estimated start date of reaction', 'If you don&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t know the exact start date of the reaction, enter the estimated start date here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction serious details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Resulted in death', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is life-threatening', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Requires inpatient hospitalization or prolongation of existing hospitalization', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Results in persistent or significant disability/incapacity (as per reporter&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s opinion)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is a congenital anomaly/birth defect', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other medically important condition', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction serious details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '302C07C9-B0E0-46AB-9EF8-5D5C2F756BF1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 0, 0, 'Did any of these reactions happen?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '3A84016D-9A58-464F-A316-027A095291CE'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Was treatment given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '24DE20BE-AB13-487B-B679-D62D6FEE8814'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 0, 0, 'What treatment was given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Outcome of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovering/resolving', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not recovered/not resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved with permanent complications', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Fatal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Outcome of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '976F6C53-78F2-4007-8F39-54057E554EEB'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (95, @dscid, @deid, 0, 0, 'What was the outcome of the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of recovery&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of recovery', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F977C2F8-C7DD-4AFE-BCAA-1C06BD54D155'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'What was the date of recovery from the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of death&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of death', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '8B15C037-9C92-4AD4-A8F4-6C4042D40D9D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (97, @dscid, @deid, 0, 0, 'Enter date if patient died from the reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction other relevant info&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction other relevant info', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '7BBEC54B-65C3-4BA6-B5A7-83C3C473F803'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 0, 0, 'Other relevant information', 'For example, does the patient have other medical problems?');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Test Results&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', 4, @dsid, 'Test Results', 'Enter information about any tests done for the reaction, along with the results.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Results Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '12D7089D-1603-4309-99DE-60F20F9A005E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Test Results', 'Test Results'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Date the test was conducted', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Name', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Name of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Result&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Result', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Result of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 35, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Low Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Low Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Lower limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- High Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('High Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Upper limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- More Information&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('More Information', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Any additional information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Reporter Information&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Information', 5, @dsid, 'Reporter Information', 'Enter information about the person reporting the reaction.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 60, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Name', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '926A07E1-8B83-41CA-8949-739717924AD9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 1, 0, 'Name or initials of person reporting information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Telephone Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Telephone Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '1AC02BD6-5C24-4A37-9742-C6B868ED985D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact telephone number for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter E-mail Address&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter E-mail Address', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'FFDA770F-DADE-4F6E-B39A-D5E929AEDE2E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact e-mail address for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Profession&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Physician', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Pharmacist', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Consumer or other non-health professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other Health Professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Lawyer', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Profession', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '79ABA1EC-3979-4BA2-80AF-1F817C8243B9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 1, 0, 'Profession of reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Report Reference Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Report Reference Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'C2EDD7A9-8031-4836-99A0-32C84D99A0AC'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'Report reference number (if any)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Place of Practice&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Place of Practice', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'A517AAE8-76BD-41F0-8FEE-BD45FCE4EBC8');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 1, 0, 'Reporter place of practise', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Keep Reporter Confidential&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Keep Reporter Confidential', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '63AE2D15-029B-4D7C-87BA-16C52A67A909'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (100, @dscid, @deid, 0, 0, 'Keep reporter confidential?', 'Do you want your identity kept confidential except to be contacted by the national medical regulatory authority or the World Health Organization if they need additional information?'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
SET ORDERING&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
SELECT ds.DatasetName, dc.DatasetCategoryName, de.ElementName FROM Dataset ds&lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategory dc ON ds.Id = dc.Dataset_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategoryElement dce ON dc.Id = dce.DatasetCategory_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetElement de ON dce.DatasetElement_Id = de.Id &lt;br /&gt;
&lt;br /&gt;
where ds.Id = @dsid&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=173</id>
		<title>OpenPV - Spontaneous Form Creation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenPV_-_Spontaneous_Form_Creation_Part_1&amp;diff=173"/>
		<updated>2024-05-23T18:23:30Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following script will create a standard Spontaneous Reporting form in OpenRIMS-PV.&amp;lt;blockquote&amp;gt;/**************************************************&lt;br /&gt;
&lt;br /&gt;
DATASET&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO dataset (DatasetName, active, initialiseprocess, RulesProcess, help, created, lastupdated, contexttype_id, createdby_id, updatedby_Id, issystem)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Spontaneous Report 2', 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 'Suspected adverse drug reaction (ADR) online reporting form', now(), now(), 4, 1, 1, 1);&lt;br /&gt;
&lt;br /&gt;
set @dsid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Patient Information&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT INTO datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Patient Information', 1, @dsid, 'Patient Information', 'Please enter some information about the person who had the adverse reaction.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Initials&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 5, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Initials', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '29CD2157-8FB6-4883-A4E6-A4B9EDE6B36B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, @dscid, @deid, 0, 0, 'Initials of Patient', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s initials here OR their ID number and type below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '5A2E89A9-8240-4665-967D-0C655CF281B7');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (2, @dscid, @deid, 1, 0, 'Identification Number', 'Enter patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s ID number OR enter their initials above..');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Identification Type&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('National Identity', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Identification Type', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E3CDDEB3-E129-4161-AC91-4DD91CC8AD4B');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (3, @dscid, @deid, 1, 0, 'Identification Type', 'If you entered a patient ID number, specify the ID type here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Date of Birth&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Date of Birth', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '0D704069-5C50-4085-8FE1-355BB64EF196');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (4, @dscid, @deid, 1, 0, 'Patient Date of Birth', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s date of birth here OR enter their age below.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 140.00, 0.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'D314C438-5ABA-4ED2-855D-1A5B22B5A301');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (5, @dscid, @deid, 1, 0, 'Age', 'Enter the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here OR enter their date of birth above.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Age Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Years', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Months', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weeks', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Days', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Age Unit', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '80C219DC-238C-487E-A3D5-8919ABA674B1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (6, @dscid, @deid, 1, 0, 'Age Unit of Measure', 'Enter weeks, months, or years for the patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s age here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Weight (kg)&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 1, 159.90, 1.10, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Weight  (kg)', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '985BD25D-54E7-4A24-8636-6DBC0F9C7B96');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (7, @dscid, @deid, 1, 0, 'Patient&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s weight (kg)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Sex&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Male', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Female', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Sex', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'E061D363-534E-4EA4-B6E5-F1C531931B12');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (8, @dscid, @deid, 0, 0, 'Sex', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Ethnic Group&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Asian', 1, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('East Asian', 0, 0, 0, @fid);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('South Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Southeast Asian', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Black', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('White', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Middle Eastern', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Ethnic Group', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'DF6717EF-A674-46DD-B738-859355ECA9A1');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (9, @dscid, @deid, 1, 0, 'Ethnic Group of Patient', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Product Information&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', 2, @dsid, 'Product Information', 'Please enter information about the product you suspect caused the reaction and about other products taken.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product Information Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Information', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '712CA632-0CD0-4418-9176-FB0B95AEE8A1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Name of product', 'Name of product.'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Product Name', 'Enter the brand or generic name'); &lt;br /&gt;
&lt;br /&gt;
-- Product Suspected&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Suspected', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Is the product suspected?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Strength', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Drug Strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug strength unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams (mg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milligrams/milliliters (mg/ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('grams (gm)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('kilograms (kg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('micrograms (mcg)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliters (ml)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('liters (l)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliequivalents (meq)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('percent (%)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drops (gtt)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug strength unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of strength', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Dose Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Dose number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Dose Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablet(s)', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('capsule(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('drop(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('teaspoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('tablespoon(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('milliliter(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('suppository(ies)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('injection(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('puff(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('inhalation(s)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('patch(es)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Unit of dosage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug route of administration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('By mouth', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Taken under the tongue', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied to a surface, usually skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Inhalation', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Applied as a medicated patch to skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Given into/under the skin', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a vein', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into a muscle', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the ear', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Into the eye', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Rectal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Vaginal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug route of administration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Drug route of administration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Start Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Start Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 8, 'Date drug usage started', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Drug End Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug End Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 9, 'Date drug usage ended', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, 0, 99999.00, 1.00, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 10, 'Duration of usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Treatment Duration Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('801=Year', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('802=Month', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('803=Week', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('804=Day', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('805=Hour', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('806=Minute', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Treatment Duration Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 11, 'Unit of duration', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Drug Indication&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 250, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Drug Indication', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Indication for drug usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Frequency&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Frequency', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Frequency of product usage', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product Batch Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 25, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product Batch Number', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 12, 'Product batch number', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
-- Actions taken with product&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product withdrawn', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose reduced', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose increased', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Dose not changed', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not applicable', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Actions taken with product', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 13, 'Actions taken with product', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product challenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product challenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 14, 'Was there a challenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Product rechallenge&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Didn&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t restart', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Product rechallenge', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 15, 'Was there a rechallenge to the usage of the product?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Reaction and Treatment&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction and Treatment', 3, @dsid, 'Reaction and Treatment', 'Enter information about what happened and how it was treated.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Description of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Description of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'ACD938A4-76D1-44CE-A070-2B8DF0FE9E0F'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (84, @dscid, @deid, 0, 0, 'Description of reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction known start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F5EEB382-D4A5-41A1-A447-37D5ECA50B99'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (85, @dscid, @deid, 0, 0, 'Start date of reaction', 'Enter the start date of the reaction OR enter the estimated start date in the next field.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction estimated start date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction estimated start date', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '67F2C8CA-503B-498C-9B7E-561BAE4DFA52');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (90, @dscid, @deid, 0, 0, 'Estimated start date of reaction', 'If you don&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;t know the exact start date of the reaction, enter the estimated start date here.');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction serious details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Resulted in death', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is life-threatening', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Requires inpatient hospitalization or prolongation of existing hospitalization', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Results in persistent or significant disability/incapacity (as per reporter&amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;s opinion)', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Is a congenital anomaly/birth defect', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other medically important condition', 0, 1, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction serious details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '302C07C9-B0E0-46AB-9EF8-5D5C2F756BF1'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 0, 0, 'Did any of these reactions happen?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '3A84016D-9A58-464F-A316-027A095291CE'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Was treatment given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Treatment given for reaction details&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Treatment given for reaction details', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '24DE20BE-AB13-487B-B679-D62D6FEE8814'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 0, 0, 'What treatment was given for the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Outcome of reaction&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovering/resolving', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Not recovered/not resolved', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Recovered/resolved with permanent complications', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Fatal', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Unknown', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Outcome of reaction', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '976F6C53-78F2-4007-8F39-54057E554EEB'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (95, @dscid, @deid, 0, 0, 'What was the outcome of the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of recovery&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of recovery', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'F977C2F8-C7DD-4AFE-BCAA-1C06BD54D155'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'What was the date of recovery from the reaction?', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction date of death&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction date of death', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '8B15C037-9C92-4AD4-A8F4-6C4042D40D9D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (97, @dscid, @deid, 0, 0, 'Enter date if patient died from the reaction', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reaction other relevant info&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 500, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reaction other relevant info', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '7BBEC54B-65C3-4BA6-B5A7-83C3C473F803'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 0, 0, 'Other relevant information', 'For example, does the patient have other medical problems?');&lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Test Results&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', 4, @dsid, 'Test Results', 'Enter information about any tests done for the reaction, along with the results.');&lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Results Table&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Results', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '12D7089D-1603-4309-99DE-60F20F9A005E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (10, @dscid, @deid, 0, 0, 'Test Results', 'Test Results'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Test Date&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Date', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 1, 'Date the test was conducted', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Name', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2, 'Name of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Result&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Result', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3, 'Result of the test', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Test Unit&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 35, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Test Unit', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 4, 'Unit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- Low Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Low Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5, 'Lower limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- High Test Range&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('High Test Range', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 6, 'Upper limit of the test result', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
-- More Information&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Yes', 1, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('No', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelementsub (elementname, field_id, datasetelement_id, oid, defaultvalue, `system`, fieldorder, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('More Information', @fid, @deid, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 7, 'Any additional information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
CATEGORY Reporter Information&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategory (datasetcategoryname, categoryorder, dataset_id, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Information', 5, @dsid, 'Reporter Information', 'Enter information about the person reporting the reaction.'); &lt;br /&gt;
&lt;br /&gt;
set @dscid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Name&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (1, 60, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Name', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '926A07E1-8B83-41CA-8949-739717924AD9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (91, @dscid, @deid, 1, 0, 'Name or initials of person reporting information', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Telephone Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Telephone Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '1AC02BD6-5C24-4A37-9742-C6B868ED985D'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact telephone number for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter E-mail Address&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 100, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter E-mail Address', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'FFDA770F-DADE-4F6E-B39A-D5E929AEDE2E'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (93, @dscid, @deid, 0, 0, 'Contact e-mail address for reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Profession&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 2); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Physician', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Pharmacist', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Consumer or other non-health professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Other Health Professional', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into fieldvalue (value, `default`, other, unknown, field_id)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Lawyer', 0, 0, 0, @fid); &lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Profession', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '79ABA1EC-3979-4BA2-80AF-1F817C8243B9'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (94, @dscid, @deid, 1, 0, 'Profession of reporter', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Report Reference Number&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 30, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Report Reference Number', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'C2EDD7A9-8031-4836-99A0-32C84D99A0AC'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (96, @dscid, @deid, 0, 0, 'Report reference number (if any)', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Reporter Place of Practice&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, 50, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 3);&lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Reporter Place of Practice', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 'A517AAE8-76BD-41F0-8FEE-BD45FCE4EBC8');&lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (98, @dscid, @deid, 1, 0, 'Reporter place of practise', &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
-- Keep Reporter Confidential&lt;br /&gt;
&lt;br /&gt;
INSERT into field (mandatory, maxlength, decimals, maxsize, minsize, calculation, filesize, fileext, anonymise, fieldtype_id)&lt;br /&gt;
&lt;br /&gt;
VALUES (0, NULL, NULL, NULL, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, NULL, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, 5); &lt;br /&gt;
&lt;br /&gt;
set @fid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetelement (elementName, field_id, datasetelementtype_id, oid, defaultvalue, `system`, datasetelementguid)&lt;br /&gt;
&lt;br /&gt;
VALUES ('Keep Reporter Confidential', @fid, 1, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, &amp;lt;nowiki&amp;gt;''&amp;lt;/nowiki&amp;gt;, 0, '63AE2D15-029B-4D7C-87BA-16C52A67A909'); &lt;br /&gt;
&lt;br /&gt;
set @deid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
INSERT into datasetcategoryelement (fieldorder, datasetcategory_id, datasetelement_id, acute, chronic, friendlyname, help)&lt;br /&gt;
&lt;br /&gt;
VALUES (100, @dscid, @deid, 0, 0, 'Keep reporter confidential?', 'Do you want your identity kept confidential except to be contacted by the national medical regulatory authority or the World Health Organization if they need additional information?'); &lt;br /&gt;
&lt;br /&gt;
set @dceid = (SELECT @@IDENTITY);&lt;br /&gt;
&lt;br /&gt;
/**************************************************&lt;br /&gt;
&lt;br /&gt;
SET ORDERING&lt;br /&gt;
&lt;br /&gt;
**************************************************/&lt;br /&gt;
&lt;br /&gt;
SELECT ds.DatasetName, dc.DatasetCategoryName, de.ElementName FROM Dataset ds&lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategory dc ON ds.Id = dc.Dataset_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetCategoryElement dce ON dc.Id = dce.DatasetCategory_Id &lt;br /&gt;
&lt;br /&gt;
INNER JOIN DatasetElement de ON dce.DatasetElement_Id = de.Id &lt;br /&gt;
&lt;br /&gt;
where ds.Id = @dsid&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=172</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=172"/>
		<updated>2024-05-14T19:55:20Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Webserver Config */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Please send an email to info@openrims.org to download the required files.&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;wget zip files for each app and api (from openrims.org/GitHub)&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/app using mc&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/api using mc&lt;br /&gt;
&lt;br /&gt;
Make dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x PViMS.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspvm.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/api&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
=== '''Post SSL Configuration''' ===&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=171</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=171"/>
		<updated>2024-05-14T19:51:57Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: Added rewrite rule&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Please send an email to info@openrims.org to download the required files.&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;wget zip files for each app and api (from openrims.org/GitHub)&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/app using mc&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/api using mc&lt;br /&gt;
&lt;br /&gt;
Make dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x PViMS.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspvm.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/api&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
== '''Webserver Config''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is just a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /var/www/html/app&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        RewriteEngine on&lt;br /&gt;
&lt;br /&gt;
        # Don't rewrite files or directories&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -f [OR]&lt;br /&gt;
&lt;br /&gt;
        RewriteCond %{REQUEST_FILENAME} -d&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ - [L]&lt;br /&gt;
&lt;br /&gt;
        # Rewrite everything else to index.html to allow HTML5 state links&lt;br /&gt;
&lt;br /&gt;
        RewriteRule ^ index.html [L]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Variations&amp;diff=170</id>
		<title>OpenRIMS-RPM - Workflow Variations</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Workflow_Variations&amp;diff=170"/>
		<updated>2024-05-09T13:50:24Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenRIMS software tracks the lifecycle of medicinal products as well as facilities related to the import, selling, storing, and manufacturing of them. This lifecycle is managed by in-country businesses and the state National Medicine Regulatory Authority (NMRA).&lt;br /&gt;
&lt;br /&gt;
The main stages of the lifecycle are:&lt;br /&gt;
&lt;br /&gt;
1.     Registration or approval&lt;br /&gt;
&lt;br /&gt;
2.     Active&lt;br /&gt;
&lt;br /&gt;
3.     De-registered&lt;br /&gt;
&lt;br /&gt;
A modification workflow intends to maintain data actuality in the Active stage:&lt;br /&gt;
&lt;br /&gt;
·       For an applicant possibility to report changes in the information initially provided.&lt;br /&gt;
&lt;br /&gt;
·       For NMRA possibility to process changes properly under the legislative&lt;br /&gt;
&lt;br /&gt;
This manual is for OpenRIMS supervisor that is motivated to create and maintain modification workflows.&lt;br /&gt;
&lt;br /&gt;
= The scenario =&lt;br /&gt;
The scenario of any modification workflow:&lt;br /&gt;
&lt;br /&gt;
1.     An applicant:&lt;br /&gt;
&lt;br /&gt;
1.1.  selects subject and object of modification and, then:&lt;br /&gt;
&lt;br /&gt;
1.2.  fills out the electronic forms of the modification application&lt;br /&gt;
&lt;br /&gt;
1.3.  submit it to NMRA&lt;br /&gt;
&lt;br /&gt;
2.     NMRA:&lt;br /&gt;
&lt;br /&gt;
2.1.  Reviews the modification and  then:&lt;br /&gt;
&lt;br /&gt;
2.1.1.Apply it to the existing object data or return the application&lt;br /&gt;
&lt;br /&gt;
2.1.2.Makes all necessary legislate actions, i.e., issue new certificates, inform Internal Revenue Commission, etc&lt;br /&gt;
&lt;br /&gt;
= Subject and object of modification =&lt;br /&gt;
              The subject of modification is a piece of information to be modified. Examples are:&lt;br /&gt;
&lt;br /&gt;
·       Pharmacy owner&lt;br /&gt;
&lt;br /&gt;
·       Capital&lt;br /&gt;
&lt;br /&gt;
·       Address of the facility&lt;br /&gt;
&lt;br /&gt;
·       Manufacturer of the medicinal product&lt;br /&gt;
&lt;br /&gt;
·       etc.,&lt;br /&gt;
&lt;br /&gt;
The object of modification is the application data to be modified. Examples are:&lt;br /&gt;
&lt;br /&gt;
·       Pharmacy # 23&lt;br /&gt;
&lt;br /&gt;
·       “Peter and Co” manufacturer&lt;br /&gt;
&lt;br /&gt;
·       Panadol medicine&lt;br /&gt;
&lt;br /&gt;
·       Etc&lt;br /&gt;
&lt;br /&gt;
For a typical application, data is collected from more than one page. Any given subject of modification can be applied only to the whole or part of data on one page.&lt;br /&gt;
&lt;br /&gt;
Thus it is important to cast the application data to pages considered necessary for future modifications.&lt;br /&gt;
&lt;br /&gt;
= Definition of the modification workflow =&lt;br /&gt;
Figure 1 The full list of modification workflows can be found in &amp;quot;dictionary.guest.amendments&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Figure 2 The item in the “dictionary.guest.amendments” contains a definition of the “Owner modification” application&lt;br /&gt;
&lt;br /&gt;
1.     The subject of modification – an electronic form&lt;br /&gt;
&lt;br /&gt;
2.     The URL of the workflow definition in the “Processes” menu&lt;br /&gt;
&lt;br /&gt;
3.     The modification application data configuration[1]&lt;br /&gt;
&lt;br /&gt;
4.     The self-check checklist that should be filled out before a modification application will be submitted&lt;br /&gt;
&lt;br /&gt;
= Modification application. The configuration of data =&lt;br /&gt;
Figure 3 Data configuration for owner modification&lt;br /&gt;
&lt;br /&gt;
1.     The first page of any modification application should contain at least “register” and “prefLabel.&lt;br /&gt;
&lt;br /&gt;
2.     The second page is the modification subject form.&lt;br /&gt;
&lt;br /&gt;
3.     The rest of the pages may contain any required application data. To simplify, this data may be placed on the first page&lt;br /&gt;
&lt;br /&gt;
= Definition of modification subject =&lt;br /&gt;
A modification may be applied to data placed on one electronic page of a modification object. The modification subject form should contain the same or fewer variables that are defined for the modified page.&lt;br /&gt;
&lt;br /&gt;
Figure 4 This subject form allows for modified addresses defined by variables in the right table&lt;br /&gt;
&lt;br /&gt;
Figure 5 It is a valid object of modification using the subject form&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 6 This object '''cannot be modified''' by the subject form&lt;br /&gt;
&lt;br /&gt;
= Modification of the whole page         =&lt;br /&gt;
It is possible to use an object’s electronic form as a subject form. However, it is possible only when a subject should modify the whole page of an object. In the example below the same configuration of the data, is in use for input and modification&lt;br /&gt;
&lt;br /&gt;
Figure 7 The &amp;quot;site.pharmacist&amp;quot; is in use for modification&lt;br /&gt;
&lt;br /&gt;
Figure 8 The &amp;quot;site.pharmacist&amp;quot; is in use for the new pharmacy application&lt;br /&gt;
&lt;br /&gt;
== Workflow steps definition ==&lt;br /&gt;
Figure 9 Workflow steps definitions  for modifications can be found here&lt;br /&gt;
&lt;br /&gt;
For a modification workflow minimum 3 steps are mandatory:&lt;br /&gt;
&lt;br /&gt;
1.     Screening&lt;br /&gt;
&lt;br /&gt;
2.     Verification or Review or something else&lt;br /&gt;
&lt;br /&gt;
3.     Finalization&lt;br /&gt;
&lt;br /&gt;
Figure 10 The last step should be marked as AMEND. The modification will be implemented on entering the previous step (in this case – Verification)&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
== Impossible to apply subject to object ==&lt;br /&gt;
Figure 11 The address modification can't be applied to any application&lt;br /&gt;
&lt;br /&gt;
              To fix this:&lt;br /&gt;
&lt;br /&gt;
Figure 12 Open the dictionary of modification workflows&lt;br /&gt;
&lt;br /&gt;
Figure 13 Determine URL of modification subject configuration&lt;br /&gt;
&lt;br /&gt;
Figure 14 The &amp;quot;modification_instruction&amp;quot; header does not exist in any object configurations&lt;br /&gt;
&lt;br /&gt;
Hint:&lt;br /&gt;
&lt;br /&gt;
·       Suspend the extra variable “modification_instruction”&lt;br /&gt;
&lt;br /&gt;
·       Place this variable on the first page of the address modification application.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----[1] Not the same as 1&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_URL_Assistant&amp;diff=169</id>
		<title>OpenRIMS-RPM - URL Assistant</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_URL_Assistant&amp;diff=169"/>
		<updated>2024-03-26T15:06:55Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The OpenRIMS allows a Supervisor User creation and modification of data input forms and workflows. The Supervisor User is presumed as a subject area expert and a qualified user of software.&lt;br /&gt;
&lt;br /&gt;
              The forms and workflows should be identified. The identifiers representation is English language words separated by dots. For example, '''marketing.auth''' is the identifier for the marketing authorization application form. Identifiers are important, because of their usage for data access, reporting, and data exchange.&lt;br /&gt;
&lt;br /&gt;
              Such representation of identifiers is known for classification systems and IT experts as Universal Resource Locators or URLs. In the OpenRIMS this term is in use too.&lt;br /&gt;
&lt;br /&gt;
              The OpenRIMS URL Assistance features a Supervisor User quick and easy way of assigning unique, concise, and human-understandable URLs.&lt;br /&gt;
&lt;br /&gt;
              The main idea under URL Assistance is the usage of the provided and own experience for the assignment of new URLs. Additionally, the URL Assistance provides strong validation of the URL assigned.&lt;br /&gt;
&lt;br /&gt;
              This manual intends to OpenRIMS Supervisors&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= URL Assistant screen =&lt;br /&gt;
              From the first release in 2024, the URL fields can be entered/changed only using URL Assistance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 1 The URL input field. Press the &amp;quot;Edit&amp;quot; icon to enter/change the URL&lt;br /&gt;
&lt;br /&gt;
              A URL Assistant screen runs in a separate browser tab. The data in the screen suits the current URL purpose:&lt;br /&gt;
&lt;br /&gt;
·       Dictionary&lt;br /&gt;
&lt;br /&gt;
·       Page in an electronic form&lt;br /&gt;
&lt;br /&gt;
·       File Resource on the page&lt;br /&gt;
&lt;br /&gt;
·       Workflow&lt;br /&gt;
&lt;br /&gt;
·       All of above&lt;br /&gt;
&lt;br /&gt;
The URL Assistant provides validation of URL:&lt;br /&gt;
&lt;br /&gt;
·       A URL should be dotting separated words containing Latin chars, numbers, and underlining:&lt;br /&gt;
&lt;br /&gt;
o  marketing.auth – right&lt;br /&gt;
&lt;br /&gt;
o  medicine marketing.auth – wrong&lt;br /&gt;
&lt;br /&gt;
o  medicine_marketing.auth – right&lt;br /&gt;
&lt;br /&gt;
·       New created URL can’t be equal to any already existing&lt;br /&gt;
&lt;br /&gt;
= Use cases =&lt;br /&gt;
&lt;br /&gt;
== A new unique URL will be needed ==&lt;br /&gt;
              This case suits when we need to create a new dictionary, page, workflow, or file resource. This case does not suit for&lt;br /&gt;
&lt;br /&gt;
·       Selection of the existing URLs&lt;br /&gt;
&lt;br /&gt;
·       URLs that should be entered manually&lt;br /&gt;
&lt;br /&gt;
Suppose, we need to create a new detailed page for the Retail Pharmacy Application. This page should contain a list of owners.&lt;br /&gt;
&lt;br /&gt;
Figure 2 Add new page&lt;br /&gt;
&lt;br /&gt;
Figure 3 Ask for the assistance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.. to be continued on the next page …&lt;br /&gt;
&lt;br /&gt;
Figure 4 The Assistant&lt;br /&gt;
&lt;br /&gt;
1.     Search for URLs that start with “pharmacy”&lt;br /&gt;
&lt;br /&gt;
2.     Select it&lt;br /&gt;
&lt;br /&gt;
3.     In the search result search for URLs that contain “retail”&lt;br /&gt;
&lt;br /&gt;
4.     Select it&lt;br /&gt;
&lt;br /&gt;
5.     Inspect existing URLs starting with “pharmacy.retail”. There is no page for owners&lt;br /&gt;
&lt;br /&gt;
6.     Add the word “owners” to the resulting URL&lt;br /&gt;
&lt;br /&gt;
7.     The result is satisfied&lt;br /&gt;
&lt;br /&gt;
Figure 5 The URL for the new page has been created using the Assistance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== An existing URL should be selected ==&lt;br /&gt;
              The URL Assistant allows select URLs for existing dictionaries, pages, resources, and workflow. For example, to add the existing page “pharmacy.retail.owners” to the application form:&lt;br /&gt;
&lt;br /&gt;
Figure 6 Ask the assistance to select a URL of the owner's page&lt;br /&gt;
&lt;br /&gt;
.. to be continued on the next page …&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.     Search for URLs that start with “pharmacy”&lt;br /&gt;
&lt;br /&gt;
2.     Select it&lt;br /&gt;
&lt;br /&gt;
3.     In the search result search for URLs that contain “retail”&lt;br /&gt;
&lt;br /&gt;
4.     Select it&lt;br /&gt;
&lt;br /&gt;
5.     Select “owners” page&lt;br /&gt;
&lt;br /&gt;
6.     Preview it&lt;br /&gt;
&lt;br /&gt;
7.     It is the right page&lt;br /&gt;
&lt;br /&gt;
8.     The result is satisfied&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A URL should be entered manually ==&lt;br /&gt;
              Despite it is strongly recommended to use existing URLs for the creation of new ones, sometimes it is impossible. For example:&lt;br /&gt;
&lt;br /&gt;
·       The URL exists, however, doesn’t belong to dictionaries, pages, resources, and workflow&lt;br /&gt;
&lt;br /&gt;
·       It is an Internet URL, like &amp;lt;nowiki&amp;gt;https://headless.horseman.org&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
·       No one of the dictionaries, pages, resources, and workflow URLs suits the task[1]&lt;br /&gt;
&lt;br /&gt;
Suppose we need to place a link to the Internet site on an application form page. This functionality is implemented by a “heading” component.&lt;br /&gt;
&lt;br /&gt;
Figure 7 Asking for the assistance&lt;br /&gt;
&lt;br /&gt;
Figure 8 The Assistant does not provide Internet URLs. Thus, enter it manually&lt;br /&gt;
&lt;br /&gt;
= How do start? =&lt;br /&gt;
              The URL Assistance screen allows a new URL input as well as the selection of the existing URL. The title of the screen informs what should be done. The titles should be defined in the “Administrate-Configurations-Messages” feature for all languages used. Recommended values for the US English language are below&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Key'''&lt;br /&gt;
|'''en_US'''&lt;br /&gt;
|-&lt;br /&gt;
|URL_ANY&lt;br /&gt;
|Select any  URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_APPLICATION_ALL&lt;br /&gt;
|Select  application URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_APPLICATION_NEW&lt;br /&gt;
|Create  application URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_DATA_ANY&lt;br /&gt;
|Select page  URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_DATA_NEW&lt;br /&gt;
|Create page  URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_DICTIONARY_ALL&lt;br /&gt;
|Select  dictionary URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_DICTIONARY_NEW&lt;br /&gt;
|Create  dictionary URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_NEW&lt;br /&gt;
|Create any  URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_RESOURCE_ALL&lt;br /&gt;
|Select  resource URL&lt;br /&gt;
|-&lt;br /&gt;
|URL_RESOURCE_NEW&lt;br /&gt;
|Create resource URL&lt;br /&gt;
|}&lt;br /&gt;
Table 1 Proposed titles in us_EN&lt;br /&gt;
&lt;br /&gt;
After the initial installation, importing simplified key workflows from the community server will be a good idea. Along with the workflows will be imported pages, dictionaries, and resources. Thus, an initial set of URLs will be available.&lt;br /&gt;
----[1] Check this carefully to avoid URL heap&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS_-_Database_Cleaning_Part_1&amp;diff=168</id>
		<title>OpenRIMS - Database Cleaning Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS_-_Database_Cleaning_Part_1&amp;diff=168"/>
		<updated>2024-02-07T23:54:37Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Purpose =&lt;br /&gt;
              The OpenRIMS-RP database contains configuration and user-defined data. The configuration data is defined by Supervisor. This data intends to manage electronic forms and workflows of applications. The user-defined data is data collected using electronic forms of applications and workflows.&lt;br /&gt;
&lt;br /&gt;
              Before the database will become production it is necessary to define the primary configuration data. Because the configuration data is particular for a country, this data should be created and tested on the sandbox or demo installation of OpenRIMS-RP.&lt;br /&gt;
&lt;br /&gt;
              While testing, the test data will be created. Thus, to prepare a production database it will be necessary to clean up all user-defined data that was created while testing, presenting, and, possible, learning.&lt;br /&gt;
&lt;br /&gt;
For the current release, there is no special defined software to clean up the database, because it is an on-time operation.&lt;br /&gt;
&lt;br /&gt;
= Pre-conditions =&lt;br /&gt;
·       MySQL Workbench is installed&lt;br /&gt;
&lt;br /&gt;
·       Connection to the database is established&lt;br /&gt;
&lt;br /&gt;
·       Connection rights to the pdx2 database allow at least select, delete, insert, execute, update, show view&lt;br /&gt;
&lt;br /&gt;
= The approach =&lt;br /&gt;
              The conceptual model[1] of the OpenRIMS-RP database is a forest of data trees built upon a relation logical model using the MySQL database engine.&lt;br /&gt;
&lt;br /&gt;
              The stored procedure “print_tree” allows selecting all branches of a data tree from the root or any node.&lt;br /&gt;
&lt;br /&gt;
              Any tree in this forest is a configuration or user-defined data, but not both. The clean database assumed the absence of user-defined data. To remove the user-defined data all data trees that contain user-defined data should be removed.&lt;br /&gt;
&lt;br /&gt;
To remove a data tree, it will be enough to remove the data tree root using the “remove_branch” stored procedure.&lt;br /&gt;
&lt;br /&gt;
              Thus, it will be necessary to recognize all roots of user-defined data and remove them by the “remove_branch” stored procedure. &lt;br /&gt;
&lt;br /&gt;
              Currently, there are no SQL queries to select roots of the user-defined-data roots, however, SQL queries to select roots of the configurations have been developed for Administrative features implementations.&lt;br /&gt;
&lt;br /&gt;
              The approach is to select all roots of configurations and, then, subtract them from the whole roots.&lt;br /&gt;
&lt;br /&gt;
= Roots of configurations =&lt;br /&gt;
              The data tree roots as well as all data tree nodes are recorded in the “concept” table. All roots can be selected using the “tree_roots” view.&lt;br /&gt;
&lt;br /&gt;
              This view is a result of SQL query&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
      `concept`.`ID` AS `ID`,&lt;br /&gt;
&lt;br /&gt;
      `concept`.`Identifier` AS `Identifier`&lt;br /&gt;
&lt;br /&gt;
   FROM&lt;br /&gt;
&lt;br /&gt;
      `concept`&lt;br /&gt;
&lt;br /&gt;
       LEFT JOIN `closure` `clos` ON `clos`.`childID` = `concept`.`ID`  AND (`clos`.`Level` &amp;lt;&amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   WHERE&lt;br /&gt;
&lt;br /&gt;
      ISNULL(`clos`.`ID`) and `concept`.`Active` -- only roots&lt;br /&gt;
&lt;br /&gt;
Each data tree root is defined by unique field “Identifier”.&lt;br /&gt;
&lt;br /&gt;
The data configuration trees are:&lt;br /&gt;
&lt;br /&gt;
1.     Authorities and users&lt;br /&gt;
&lt;br /&gt;
2.     Workflows&lt;br /&gt;
&lt;br /&gt;
3.     Dictionaries&lt;br /&gt;
&lt;br /&gt;
4.     Resources&lt;br /&gt;
&lt;br /&gt;
5.     Files uploaded to resources&lt;br /&gt;
&lt;br /&gt;
6.     Configurations of data&lt;br /&gt;
&lt;br /&gt;
7.     Configurations of reports&lt;br /&gt;
&lt;br /&gt;
8.     Tiles&lt;br /&gt;
&lt;br /&gt;
9.     Legacy data&lt;br /&gt;
&lt;br /&gt;
These configurations will not be extended until the next version of OpenRIMS-RP software.&lt;br /&gt;
&lt;br /&gt;
= Authorities and users =&lt;br /&gt;
              All users are branches of a tree. The root of this tree is “user.data”.&lt;br /&gt;
&lt;br /&gt;
All authorities are branches of a tree “organization.authority”.&lt;br /&gt;
&lt;br /&gt;
              The SQL query to select roots:&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('organization.authority', 'user.data')&lt;br /&gt;
&lt;br /&gt;
= Workflow definitions =&lt;br /&gt;
              Workflow definitions allow control user’s application processing.&lt;br /&gt;
&lt;br /&gt;
              The definition of a workflow is stored in a tree. The root URL is “configuration.”URL of a workflow”, e.g., “configuration.application.retail.site.owned.pvt”. All root URLs can be gotten from lifecycle dictionaries:&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.deregistration&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.amendments&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.applications&lt;br /&gt;
&lt;br /&gt;
·       dictionary.guest.renewal&lt;br /&gt;
&lt;br /&gt;
·       dictionary.shutdown.applications&lt;br /&gt;
&lt;br /&gt;
·       dictionary.host.applications&lt;br /&gt;
&lt;br /&gt;
The SQL query to select all root URL’s from the life cycle dictionaries is:&lt;br /&gt;
&lt;br /&gt;
SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              The SQL to select all workflow definition roots is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- query for workflow definition URLs from the lifecycle dictionaries&lt;br /&gt;
&lt;br /&gt;
                                             SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
                                             join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
                                             )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Dictionaries =&lt;br /&gt;
              Dictionaries contains pre-defined classifiers used by data input forms. Each dictionary is a tree.&lt;br /&gt;
&lt;br /&gt;
              By the agreement, all URLs of dictionaries should start with “dictionary.”. Thus, SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier like 'dictionary.%'&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
              The definition of a resource consists of:&lt;br /&gt;
&lt;br /&gt;
1.     Resource definition&lt;br /&gt;
&lt;br /&gt;
2.     Data configuration&lt;br /&gt;
&lt;br /&gt;
3.     Dictionary&lt;br /&gt;
&lt;br /&gt;
4.     Stored files&lt;br /&gt;
&lt;br /&gt;
The data configuration and dictionary are common configuration trees,  that can be gotten by the appropriate SQLs (see above and below)&lt;br /&gt;
&lt;br /&gt;
Resource definitions are branches of the root URL “configuration.resources”.&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
= Files, uploaded to resources =&lt;br /&gt;
The resource files are stored in a tree for each resource. The root URL is defined in the resource data configurations. A data configuration of a resource is a uniform data configuration.  Thus, it is necessary:&lt;br /&gt;
&lt;br /&gt;
1.     Select URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
2.     Select data configurations for all resources, using data configuration URLs&lt;br /&gt;
&lt;br /&gt;
3.     Select URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
4.     Select file trees, using the URLs&lt;br /&gt;
&lt;br /&gt;
URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&gt;
clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
item.Active and&lt;br /&gt;
&lt;br /&gt;
c.Active and&lt;br /&gt;
&lt;br /&gt;
c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Data configurations for all resources:&lt;br /&gt;
&lt;br /&gt;
SELECT conf.ID, conf.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
and c.Active&lt;br /&gt;
&lt;br /&gt;
and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                              -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                              SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                              FROM concept c&lt;br /&gt;
&lt;br /&gt;
                              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                              join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                              join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                              join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                              left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                              where&lt;br /&gt;
&lt;br /&gt;
                              clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                              item.Active and&lt;br /&gt;
&lt;br /&gt;
                               c.Active and&lt;br /&gt;
&lt;br /&gt;
                               c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
)            &lt;br /&gt;
&lt;br /&gt;
URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
              FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
   -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
              join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
              join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
              join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
   -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
              join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
   -- roots&lt;br /&gt;
&lt;br /&gt;
              left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
              where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
               and c.Active&lt;br /&gt;
&lt;br /&gt;
               and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
               and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                             SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             item.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
               )&lt;br /&gt;
&lt;br /&gt;
File trees:&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
&lt;br /&gt;
       -- URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
       SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
       FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
  -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
       join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
       join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
       join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
       join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
  -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
       join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
  -- roots&lt;br /&gt;
&lt;br /&gt;
       left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
       where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
        and c.Active&lt;br /&gt;
&lt;br /&gt;
        and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
        and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                      -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                      SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                      FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                      join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                      join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                      join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                      join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                      left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                      where&lt;br /&gt;
&lt;br /&gt;
                                      clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                      item.Active and&lt;br /&gt;
&lt;br /&gt;
                                       c.Active and&lt;br /&gt;
&lt;br /&gt;
                                       c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
        )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
= Configurations of data =&lt;br /&gt;
              Configurations of data intends to manage on-screen forms for configurations and user-defined data  For each form the configuration allows to assign:&lt;br /&gt;
&lt;br /&gt;
·       Form layout on a screen&lt;br /&gt;
&lt;br /&gt;
·       Data input fields, i.e., text, numeric, dates, logical&lt;br /&gt;
&lt;br /&gt;
·       Data input components, i.e., dictionaries, registers, resource downloads, etc.&lt;br /&gt;
&lt;br /&gt;
·       Data validation rules&lt;br /&gt;
&lt;br /&gt;
              Details may be found here (MSH, 2022)&lt;br /&gt;
&lt;br /&gt;
              For each data form the configuration is a branch in the tree with URL “configuration.data”&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
= Configurations of reports =&lt;br /&gt;
              Configurations of internal reports intend to define parameters to execute internal reports. For each report configuration is a branch in a tree with root URL “report.configuration”&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('report.configuration')&lt;br /&gt;
&lt;br /&gt;
= Tiles =&lt;br /&gt;
              Tiles is a system dictionary “dictionary.system.tiles”&lt;br /&gt;
&lt;br /&gt;
= Legacy Data =&lt;br /&gt;
              The legacy data may be placed to one or more trees. The URLs of the roots should be clarified for the installation. For Nepal database URLs are “system.import.legacy.data”, “legacy.pharmacies” and “legacy.ws”.&lt;br /&gt;
&lt;br /&gt;
The SQL is&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('legacy.pharmacies', 'legacy.ws', 'system.import.legacy.data')&lt;br /&gt;
&lt;br /&gt;
= Put it all together =&lt;br /&gt;
Create two database views:&lt;br /&gt;
&lt;br /&gt;
'''tree_configurations:'''&lt;br /&gt;
&lt;br /&gt;
-- 1.        Authorities and users&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('organization.authority', 'user.data')&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 2.        Workflows&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- query for workflow definition URLs from the lifecycle dictionaries&lt;br /&gt;
&lt;br /&gt;
                                             SELECT distinct concat('configuration.',val.Label)&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=3&lt;br /&gt;
&lt;br /&gt;
                                             join concept var on var.ID=clo1.childID and var.Identifier='applicationurl'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=var.ID and clo2.Level=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept val on val.ID=clo2.childID and val.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             c.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.deregistration',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.amendments',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.guest.renewal',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.shutdown.applications',&lt;br /&gt;
&lt;br /&gt;
                                             'dictionary.host.applications'&lt;br /&gt;
&lt;br /&gt;
                                             )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 3.        Dictionaries&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier like 'dictionary.%'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 4.        Resources&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 5.       Files uploaded to resources&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in&lt;br /&gt;
&lt;br /&gt;
(&lt;br /&gt;
&lt;br /&gt;
              -- URLs of file trees from the data configurations&lt;br /&gt;
&lt;br /&gt;
              SELECT asm.Url&lt;br /&gt;
&lt;br /&gt;
              FROM concept c  -- roots of configurations (right table on the screen)&lt;br /&gt;
&lt;br /&gt;
   -- variables for configurations (left table on the screen)&lt;br /&gt;
&lt;br /&gt;
              join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
              join concept conf on conf.ID=clo1.childID&lt;br /&gt;
&lt;br /&gt;
              join closure clo2 on clo2.parentID=conf.ID and clo2.Level='1'&lt;br /&gt;
&lt;br /&gt;
              join concept var on var.ID=clo2.childID and var.Identifier &amp;lt;&amp;gt; '_LITERALS_' and var.Active&lt;br /&gt;
&lt;br /&gt;
   -- get only files (documents) from the configuration variables&lt;br /&gt;
&lt;br /&gt;
              join assembly asm on asm.conceptID=var.ID and asm.Clazz='documents'&lt;br /&gt;
&lt;br /&gt;
   -- roots&lt;br /&gt;
&lt;br /&gt;
              left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
              where clo.ID is null&lt;br /&gt;
&lt;br /&gt;
               and c.Active&lt;br /&gt;
&lt;br /&gt;
               and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
               and conf.Identifier in (&lt;br /&gt;
&lt;br /&gt;
                                             -- URLs of data configurations for all resources&lt;br /&gt;
&lt;br /&gt;
                                             SELECT item.Label&lt;br /&gt;
&lt;br /&gt;
                                             FROM concept c&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo1 on clo1.parentID=c.ID and clo1.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept lang on lang.ID=clo1.childID and lang.Identifier='EN_US'&lt;br /&gt;
&lt;br /&gt;
                                             join closure clo2 on clo2.parentID=lang.ID and clo2.`Level`=1&lt;br /&gt;
&lt;br /&gt;
                                             join concept item on item.ID=clo2.childID&lt;br /&gt;
&lt;br /&gt;
                                             left join closure clo on clo.childID=c.ID and clo.`Level`&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
                                             where&lt;br /&gt;
&lt;br /&gt;
                                             clo.ID is null and&lt;br /&gt;
&lt;br /&gt;
                                             item.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Active and&lt;br /&gt;
&lt;br /&gt;
                                              c.Identifier='configuration.resources'&lt;br /&gt;
&lt;br /&gt;
               )&lt;br /&gt;
&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 6.        Configurations of data&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('configuration.data')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 7.        Configurations of reports&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('report.configuration')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
union&lt;br /&gt;
&lt;br /&gt;
-- 8.        Tiles are a dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- 9.        Legacy data&lt;br /&gt;
&lt;br /&gt;
SELECT c.ID, c.Identifier&lt;br /&gt;
&lt;br /&gt;
FROM concept c&lt;br /&gt;
&lt;br /&gt;
left join closure clo on clo.childID=c.ID and clo.Level&amp;lt;&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
where clo.ID is null and c.Active and c.Identifier in ('legacy.pharmacies', 'legacy.ws', 'system.import.legacy.data')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''tree_userdefined:'''&lt;br /&gt;
&lt;br /&gt;
SELECT c.*&lt;br /&gt;
&lt;br /&gt;
   FROM&lt;br /&gt;
&lt;br /&gt;
              `concept` `c`&lt;br /&gt;
&lt;br /&gt;
       LEFT JOIN `closure` `clo` ON `clo`.`childID` = `c`.`ID`&lt;br /&gt;
&lt;br /&gt;
           AND (`clo`.`Level` &amp;lt;&amp;gt; 0)&lt;br /&gt;
&lt;br /&gt;
   WHERE&lt;br /&gt;
&lt;br /&gt;
      ISNULL(`clo`.`ID`) AND `c`.`Active`&lt;br /&gt;
&lt;br /&gt;
           AND NOT  `c`.`ID` IN (SELECT&lt;br /&gt;
&lt;br /&gt;
              `tree_configurations`.`ID`&lt;br /&gt;
&lt;br /&gt;
           FROM&lt;br /&gt;
&lt;br /&gt;
               `tree_configurations`)&lt;br /&gt;
&lt;br /&gt;
= Generate cleaning script =&lt;br /&gt;
SELECT concat('call remove_branch(',c.ID, ');', '-- ', c.Identifier) as 'sql'&lt;br /&gt;
&lt;br /&gt;
FROM tree_userdefined c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              This script may run a long time.&lt;br /&gt;
----[1] sciencedirect.com/topics/computer-science/conceptual-data-model&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=Common_Standards_for_RIMS&amp;diff=167</id>
		<title>Common Standards for RIMS</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=Common_Standards_for_RIMS&amp;diff=167"/>
		<updated>2024-02-06T15:09:23Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
Through a consultative proces an international team is recommending that the below listed minimum standards are considered for inclusion in an RIMS design.&lt;br /&gt;
&lt;br /&gt;
A thorough report is available in the report ''&amp;quot;USAID MTaPS and PQM+ Programs. Pathway to Digitalize Regulatory Information Management Systems for National Medicines Regulatory Authorities in Low- and Middle-Income Countries. Submitted to the US Agency for International Development by the USAID PQM+ and MTaPS Programs.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== Process Standards ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Good Laboratory Practices (GLP)&lt;br /&gt;
|-&lt;br /&gt;
|Monographs&lt;br /&gt;
|-&lt;br /&gt;
|ISO 9001:2015 - Quality  Management System Procedures&lt;br /&gt;
|-&lt;br /&gt;
|Good Distribution Practices (GDP)&lt;br /&gt;
|-&lt;br /&gt;
|ISO 17025:2017&lt;br /&gt;
|-&lt;br /&gt;
|Good Practices For Pharmaceutical  Quality Control Laboratories&lt;br /&gt;
|-&lt;br /&gt;
|Good Clinical Practice (GCP)&lt;br /&gt;
|-&lt;br /&gt;
|Good Manufacturing Practices  (GMP) or ICH Q7&lt;br /&gt;
|-&lt;br /&gt;
|Good Practices For Pharmaceutical  Microbiology Laboratories&lt;br /&gt;
|-&lt;br /&gt;
|Good Review Practices (GRevP)&lt;br /&gt;
|-&lt;br /&gt;
|Good Storage Practices (GSP)&lt;br /&gt;
|-&lt;br /&gt;
|ICH Q10&lt;br /&gt;
|-&lt;br /&gt;
|Good Pharmacovigilance Practices&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dictionaries &amp;amp; Knowledge Trees ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|International Nonproprietary  Names (INN)&lt;br /&gt;
|-&lt;br /&gt;
|Anatomical Therapeutic Chemical  Index (ATC)&lt;br /&gt;
|-&lt;br /&gt;
|WHODrug  Global&lt;br /&gt;
|-&lt;br /&gt;
|National Drug Code (NDC)&lt;br /&gt;
|-&lt;br /&gt;
|The Medical Dictionary for  Regulatory Activities (MedDRA)&lt;br /&gt;
|-&lt;br /&gt;
|Chemical Abstracts Service (CAS)  registry number&lt;br /&gt;
|-&lt;br /&gt;
|Unique Ingredient Identifier  (UNII)&lt;br /&gt;
|-&lt;br /&gt;
|ISO 11238 Substance  Identification (SubID)&lt;br /&gt;
|-&lt;br /&gt;
|GS1 Standards&lt;br /&gt;
|-&lt;br /&gt;
|ISO 11615 Medicinal Product  Identification (MPID)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Data Exchange Standards ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Portable Document Format (PDF)&lt;br /&gt;
|-&lt;br /&gt;
|XML&lt;br /&gt;
|-&lt;br /&gt;
|Common Technical Document (CTD)&lt;br /&gt;
|-&lt;br /&gt;
|E2B - Pharmacovigilance:  Individual Case Safety Reports (ICSR) or ISO/HL7 27953-2:2011&lt;br /&gt;
|-&lt;br /&gt;
|Structured Product Labelling  (SPL)&lt;br /&gt;
|-&lt;br /&gt;
|Fast Healthcare Interoperability  Standards (FHIR)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Base_Configuration_Part_2&amp;diff=166</id>
		<title>OpenRIMS-RPM - Base Configuration Part 2</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Base_Configuration_Part_2&amp;diff=166"/>
		<updated>2024-02-02T11:29:30Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Data Use for Regulatory Authorities ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
OpenRIMS is designed to use Google Looker Studio.&lt;br /&gt;
&lt;br /&gt;
A Test dashboard is provided in the link below and can be cloned for any onboarding authority.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After creating a copy a few steps must be performed:&lt;br /&gt;
&lt;br /&gt;
# Replace the top banner&lt;br /&gt;
# Replace the data sources&lt;br /&gt;
# Prepare content against regulatory requirements&lt;br /&gt;
&lt;br /&gt;
=== Replace the top banner ===&lt;br /&gt;
Use Paint or a simple image editor to screengrab the new banner off the OpenRIMS website.&lt;br /&gt;
&lt;br /&gt;
Save it locally.&lt;br /&gt;
&lt;br /&gt;
In the Test Google Looker Studio copy choose insert and adjust as needed.&lt;br /&gt;
&lt;br /&gt;
=== Replace the data sources ===&lt;br /&gt;
Click Resource and then Manage added resources to create a new connection to MySQL providing username and password for a restricted readonly MySQL database account.&lt;br /&gt;
&lt;br /&gt;
Choose a table or provide a MySQL query targeting the data you want to present in the dashboard.&lt;br /&gt;
&lt;br /&gt;
Save it and go back to design the dashboard.&lt;br /&gt;
&lt;br /&gt;
=== Prepare content against regulatory requirements ===&lt;br /&gt;
Have discussions with the Authority to define KPIs.&lt;br /&gt;
&lt;br /&gt;
The KPIs should conform and align with international standards from WHO and other relevant national and regional institutions.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Configuration_Part_1&amp;diff=165</id>
		<title>OpenRIMS-RPM - Configuration Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Configuration_Part_1&amp;diff=165"/>
		<updated>2024-01-30T01:42:06Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Import data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section describes how to use the WHO ATC/DDD standard in OpenRIMS-RPM.&lt;br /&gt;
&lt;br /&gt;
In the Anatomical Therapeutic Chemical (ATC) classification system, the active substances are divided into different groups according to the organ or system on which they act and their therapeutic, pharmacological, and chemical properties. Drugs are classified at five different levels.&lt;br /&gt;
&lt;br /&gt;
Details and tutorials can be found here &amp;lt;nowiki&amp;gt;https://www.who.int/tools/atc-ddd-toolkit/atc-classification&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
WHO provides a free online actual electronic list of internationally recognized ATC here &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In addition, &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt; the ATC data can be ordered in MS Excel format at a cost.&lt;br /&gt;
&lt;br /&gt;
Along with ATC codes and active substances, the ATC list contains Defined Daily Dosage (DDD) for active substances. The DDD provides Units of Measurement (UOM) and Routes of Administration dictionaries.&lt;br /&gt;
&lt;br /&gt;
Thus, the electronic list from WHO provides to Pharmadex 2:&lt;br /&gt;
&lt;br /&gt;
* Active ingredients, recognized by WHO and grouped by ATC codes (who.atc.human)&lt;br /&gt;
* WHO Dosage units dictionary (dictionary.who.uom)&lt;br /&gt;
* WHO route of administration dictionary (dictionary.who.adminroute)&lt;br /&gt;
&lt;br /&gt;
This manual intends for the OpenRIMS-RE supervisor user that is responsible for data maintenance.&lt;br /&gt;
&lt;br /&gt;
= Source Data =&lt;br /&gt;
The data supported by WHO can be ordered here  &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt;. This data contains English and Spanish versions of actual ATC/DDD registered in WHO. The data is in MS Excel (xlsx) format.&lt;br /&gt;
&lt;br /&gt;
= Import data =&lt;br /&gt;
&lt;br /&gt;
Figure 1 Import the WHO ATC-DDD file&lt;br /&gt;
&lt;br /&gt;
# Download the non-official MS Excel file of WHO online data for 2021-12-03 only if you do have not the official data &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
# Upload the MS Excel file to import&lt;br /&gt;
# Press “Save” to start the import. The import process will be run in the background. It is possible to do another job, however, the content of the ATC component will be locked.&lt;br /&gt;
# Press “Reload” to check the status – how many imported, how many are left&lt;br /&gt;
# Intermediate and final statuses will be found under the “dataimport_result”&lt;br /&gt;
# The result of the importing will be available here (Figure 2)&lt;br /&gt;
&lt;br /&gt;
Figure 2 The result of the importing&lt;br /&gt;
&lt;br /&gt;
In addition, such dictionaries will be created:&lt;br /&gt;
&lt;br /&gt;
* dictionary.who.uom – Units of measures&lt;br /&gt;
* dictionary.who.adminroute – administrate routes&lt;br /&gt;
&lt;br /&gt;
The values of these dictionaries are from DDD columns in the Excel file. These values are abbreviations that are not clear for a plain user. After the import, it will be recommended to add descriptions of them manually using the official WHO sources &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Re-import =&lt;br /&gt;
The complete data file should be used for re-import. Follow the same procedure as for the initial import. The re-import procedure:&lt;br /&gt;
&lt;br /&gt;
# Makes unusable all ATC records that are not present in the Excel file&lt;br /&gt;
# Add new ATC records to the database that is present in the Excel file, but not present in the database&lt;br /&gt;
&lt;br /&gt;
The e-import software determines the ATC record in the Excel file and the database as the same when all the following conditions will occur:&lt;br /&gt;
&lt;br /&gt;
* ATC codes are equals&lt;br /&gt;
* DDD, UoM, and Admin Route are equal or empty in the both&lt;br /&gt;
&lt;br /&gt;
For dictionaries  dictionary.who.uom and dictionary.who.adminroute:&lt;br /&gt;
&lt;br /&gt;
* The existing data will not be re-written&lt;br /&gt;
* The new abbreviations will be added&lt;br /&gt;
&lt;br /&gt;
= Country specific data =&lt;br /&gt;
It is possible when a country uses active ingredients, UoMs, and routes of administration, that are not listed in the WHO data. In this case, this data should be added manually.&lt;br /&gt;
&lt;br /&gt;
* For the active ingredients, country-specific records should be added to the end of the WHO data. The coding and description should follow rules for a particular country.&lt;br /&gt;
* UOMs should be added to the dictionary.who.uom&lt;br /&gt;
* Route of Administration should be added to the dictionary.who.adminroute&lt;br /&gt;
&lt;br /&gt;
= Languages =&lt;br /&gt;
For current, it is no way to determine ATC and active ingredient data in the national language. This feature will be added soon.&lt;br /&gt;
&lt;br /&gt;
For dictionary.who.uom and dictionary.who.adminroute it is possible to add data in the national language like to any other dictionary.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
== Component “ATC” ==&lt;br /&gt;
The “ATC” component is dedicated to selecting ATC codes. Details can be found here &amp;lt;nowiki&amp;gt;http://redmine.inka.in.ua/documents/129&amp;lt;/nowiki&amp;gt;. From November 2022 this component will be deprecated in favor of the “links” component.&lt;br /&gt;
&lt;br /&gt;
Figure 3 ATC component&lt;br /&gt;
&lt;br /&gt;
Figure 4 ATC component configuration&lt;br /&gt;
&lt;br /&gt;
== Component “links” ==&lt;br /&gt;
The “links” is a universal component that allows adding references to the:&lt;br /&gt;
&lt;br /&gt;
* Application's data&lt;br /&gt;
* Imported legacy data&lt;br /&gt;
* Imported ATC codes&lt;br /&gt;
&lt;br /&gt;
Details can be found here &amp;lt;nowiki&amp;gt;http://redmine.inka.in.ua/documents/129&amp;lt;/nowiki&amp;gt;. The usage of this component is strongly recommended instead of the ATC component.&lt;br /&gt;
&lt;br /&gt;
Figure 5 Usage of component &amp;quot;links&amp;quot; for active ingredient references&lt;br /&gt;
&lt;br /&gt;
Figure 6 The configuration of the component above&lt;br /&gt;
&lt;br /&gt;
The value of the field “Name” is “Yes, thus the selection will be copied to literals:&lt;br /&gt;
&lt;br /&gt;
* prefLabel - selected ingredient&lt;br /&gt;
* description - selected ingredient along with ATC, DDD, and notes&lt;br /&gt;
* atc - ATC code&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Configuration_Part_1&amp;diff=164</id>
		<title>OpenRIMS-RPM - Configuration Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Configuration_Part_1&amp;diff=164"/>
		<updated>2024-01-29T20:38:42Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section describes how to use the WHO ATC/DDD standard in OpenRIMS-RPM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the Anatomical Therapeutic Chemical (ATC) classification system, the active substances are divided into different groups according to the organ or system on which they act and their therapeutic, pharmacological, and chemical properties. Drugs are classified at five different levels.&lt;br /&gt;
&lt;br /&gt;
Details and tutorials can be found here &amp;lt;nowiki&amp;gt;https://www.who.int/tools/atc-ddd-toolkit/atc-classification&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
WHO provides a free online actual electronic list of internationally recognized ATC here &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In addition, &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt; the ATC data can be ordered in MS Excel format at a cost.&lt;br /&gt;
&lt;br /&gt;
Along with ATC codes and active substances, the ATC list contains Defined Daily Dosage (DDD) for active substances. The DDD provides Units of Measurement (UOM) and Routes of Administration dictionaries.&lt;br /&gt;
&lt;br /&gt;
Thus, the electronic list from WHO provides to Pharmadex 2:&lt;br /&gt;
&lt;br /&gt;
* Active ingredients, recognized by WHO and grouped by ATC codes (who.atc.human)&lt;br /&gt;
* WHO Dosage units dictionary (dictionary.who.uom)&lt;br /&gt;
* WHO route of administration dictionary (dictionary.who.adminroute)&lt;br /&gt;
&lt;br /&gt;
This manual intends for the OpenRIMS-RE supervisor user that is responsible for data maintenance.&lt;br /&gt;
&lt;br /&gt;
= Source Data =&lt;br /&gt;
The data supported by WHO can be ordered here  &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt;. This data contains English and Spanish versions of actual ATC/DDD registered in WHO. The data is in MS Excel (xlsx) format.&lt;br /&gt;
&lt;br /&gt;
= Import data =&lt;br /&gt;
&lt;br /&gt;
Figure 1 Import the WHO ATC-DDD file&lt;br /&gt;
&lt;br /&gt;
# Download the non-official MS Excel file of WHO online data for 2021-12-03 only if you do have not the official data &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
# Upload the MS Excel file to import&lt;br /&gt;
# Press “Save” to start the import. The import process will be run in the background. It is possible to do another job, however, the content of the ATC component will be locked.&lt;br /&gt;
# Press “Reload” to check the status – how many imported, how many are left&lt;br /&gt;
# Intermediate and final statuses will be found under the “dataimport_result”&lt;br /&gt;
# The result of the importing will be available here (Figure 2)&lt;br /&gt;
&lt;br /&gt;
Figure 2 The result of the importing&lt;br /&gt;
&lt;br /&gt;
In addition, such dictionaries will be created:&lt;br /&gt;
&lt;br /&gt;
* dictionary.who.uom – Units of measures&lt;br /&gt;
* dictionary.who.adminroute – administrate routes&lt;br /&gt;
&lt;br /&gt;
The values of these dictionaries are from DDD columns in the Excel file. These values are abbreviations that are not clear for a plain user. After the import, it will be recommended to add descriptions of them manually using the official WHO sources &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Re-import =&lt;br /&gt;
The complete data file should be used for re-import. Follow the same procedure as for the initial import. The re-import procedure:&lt;br /&gt;
&lt;br /&gt;
# Makes unusable all ATC records that are not present in the Excel file&lt;br /&gt;
# Add new ATC records to the database that is present in the Excel file, but not present in the database&lt;br /&gt;
&lt;br /&gt;
The e-import software determines the ATC record in the Excel file and the database as the same when all the following conditions will occur:&lt;br /&gt;
&lt;br /&gt;
* ATC codes are equals&lt;br /&gt;
* DDD, UoM, and Admin Route are equal or empty in the both&lt;br /&gt;
&lt;br /&gt;
For dictionaries  dictionary.who.uom and dictionary.who.adminroute:&lt;br /&gt;
&lt;br /&gt;
* The existing data will not be re-written&lt;br /&gt;
* The new abbreviations will be added&lt;br /&gt;
&lt;br /&gt;
= Country specific data =&lt;br /&gt;
It is possible when a country uses active ingredients, UoMs, and routes of administration, that are not listed in the WHO data. In this case, this data should be added manually.&lt;br /&gt;
&lt;br /&gt;
* For the active ingredients, country-specific records should be added to the end of the WHO data. The coding and description should follow rules for a particular country.&lt;br /&gt;
* UOMs should be added to the dictionary.who.uom&lt;br /&gt;
* Route of Administration should be added to the dictionary.who.adminroute&lt;br /&gt;
&lt;br /&gt;
= Languages =&lt;br /&gt;
For current, it is no way to determine ATC and active ingredient data in the national language. This feature will be added soon.&lt;br /&gt;
&lt;br /&gt;
For dictionary.who.uom and dictionary.who.adminroute it is possible to add data in the national language like to any other dictionary.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
== Component “ATC” ==&lt;br /&gt;
The “ATC” component is dedicated to selecting ATC codes. Details can be found here &amp;lt;nowiki&amp;gt;http://redmine.inka.in.ua/documents/129&amp;lt;/nowiki&amp;gt;. From November 2022 this component will be deprecated in favor of the “links” component.&lt;br /&gt;
&lt;br /&gt;
Figure 3 ATC component&lt;br /&gt;
&lt;br /&gt;
Figure 4 ATC component configuration&lt;br /&gt;
&lt;br /&gt;
== Component “links” ==&lt;br /&gt;
The “links” is a universal component that allows adding references to the:&lt;br /&gt;
&lt;br /&gt;
* Application's data&lt;br /&gt;
* Imported legacy data&lt;br /&gt;
* Imported ATC codes&lt;br /&gt;
&lt;br /&gt;
Details can be found here &amp;lt;nowiki&amp;gt;http://redmine.inka.in.ua/documents/129&amp;lt;/nowiki&amp;gt;. The usage of this component is strongly recommended instead of the ATC component.&lt;br /&gt;
&lt;br /&gt;
Figure 5 Usage of component &amp;quot;links&amp;quot; for active ingredient references&lt;br /&gt;
&lt;br /&gt;
Figure 6 The configuration of the component above&lt;br /&gt;
&lt;br /&gt;
The value of the field “Name” is “Yes, thus the selection will be copied to literals:&lt;br /&gt;
&lt;br /&gt;
* prefLabel - selected ingredient&lt;br /&gt;
* description - selected ingredient along with ATC, DDD, and notes&lt;br /&gt;
* atc - ATC code&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Configuration_Part_1&amp;diff=163</id>
		<title>OpenRIMS-RPM - Configuration Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Configuration_Part_1&amp;diff=163"/>
		<updated>2024-01-29T20:34:55Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section describes how to use the WHO ATC/DDD standard in OpenRIMS-RPM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the Anatomical Therapeutic Chemical (ATC) classification system, the active substances are divided into different groups according to the organ or system on which they act and their therapeutic, pharmacological, and chemical properties. Drugs are classified at five different levels.&lt;br /&gt;
&lt;br /&gt;
              Details and tutorials can be found here &amp;lt;nowiki&amp;gt;https://www.who.int/tools/atc-ddd-toolkit/atc-classification&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
              WHO provides a free online actual electronic list of internationally recognized ATC here &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In addition, &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt; the ATC data can be ordered in MS Excel format. This order is for money.&lt;br /&gt;
&lt;br /&gt;
              Along with ATC codes and active substances, the ATC list contains Defined Daily Dosage (DDD) for active substances. The DDD provides Units of Measurement (UOM) and Routes of Administration dictionaries.&lt;br /&gt;
&lt;br /&gt;
              Thus, the electronic list from WHO provides to Pharmadex 2:&lt;br /&gt;
&lt;br /&gt;
·       Active ingredients, recognized by WHO and grouped by ATC codes (who.atc.human)&lt;br /&gt;
&lt;br /&gt;
·       WHO Dosage units dictionary (dictionary.who.uom)&lt;br /&gt;
&lt;br /&gt;
·       WHO route of administration dictionary (dictionary.who.adminroute)&lt;br /&gt;
&lt;br /&gt;
This manual intends for Pharmadex 2 supervisor user that is responsible for data maintenance.&lt;br /&gt;
&lt;br /&gt;
= Source Data =&lt;br /&gt;
              The data supported by WHO can be ordered here  &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt;. This data contains English and Spanish versions of actual ATC/DDD registered in WHO. The data is in MS Excel (xlsx) format. The layout of the data seems as stable.&lt;br /&gt;
&lt;br /&gt;
= Import data =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 1 Import the WHO ATC-DDD file&lt;br /&gt;
&lt;br /&gt;
1.     Download the non-official MS Excel file of WHO online data for 2021-12-03 only if you do have not the official data &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index_and_guidelines/order/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2.     Upload the MS Excel file to import&lt;br /&gt;
&lt;br /&gt;
3.     Press “Save” to start the import. The import process will be run in the background. It is possible to do another job, however, the content of the ATC component will be locked.&lt;br /&gt;
&lt;br /&gt;
4.     Press “Reload” to check the status – how many imported, how many are left&lt;br /&gt;
&lt;br /&gt;
5.     Intermediate and final statuses will be found under the “dataimport_result”&lt;br /&gt;
&lt;br /&gt;
6.     The result of the importing will be available here (Figure 2)&lt;br /&gt;
&lt;br /&gt;
Figure 2 The result of the importing&lt;br /&gt;
&lt;br /&gt;
              In addition, such dictionaries will be created:&lt;br /&gt;
&lt;br /&gt;
·       dictionary.who.uom – Units of measures&lt;br /&gt;
&lt;br /&gt;
·       dictionary.who.adminroute – administrate routes&lt;br /&gt;
&lt;br /&gt;
The values of these dictionaries are from DDD columns in the Excel file. These values are abbreviations that are not clear for a plain user. After the import, it will be recommended to add descriptions of them manually using the official WHO sources &amp;lt;nowiki&amp;gt;https://www.whocc.no/atc_ddd_index/&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Re-import =&lt;br /&gt;
              The complete data file should be used for re-import. Follow the same procedure as for the initial import. The re-import procedure:&lt;br /&gt;
&lt;br /&gt;
1.     Makes unusable all ATC records that are not present in the Excel file&lt;br /&gt;
&lt;br /&gt;
2.     Add new ATC records to the database that is present in the Excel file, but not present in the database&lt;br /&gt;
&lt;br /&gt;
The e-import software determines the ATC record in the Excel file and the database as the same when all the following conditions will occur:&lt;br /&gt;
&lt;br /&gt;
·       ATC codes are equals&lt;br /&gt;
&lt;br /&gt;
·       DDD, UoM, and Admin Route are equal or empty in the both&lt;br /&gt;
&lt;br /&gt;
For dictionaries  dictionary.who.uom and dictionary.who.adminroute:&lt;br /&gt;
&lt;br /&gt;
·       The existing data will not be re-written&lt;br /&gt;
&lt;br /&gt;
·       The new abbreviations will be added&lt;br /&gt;
&lt;br /&gt;
= Country specific data =&lt;br /&gt;
              It is possible when a country uses active ingredients, UoMs, and routes of administration, that are not listed in the WHO data. In this case, this data should be added manually.&lt;br /&gt;
&lt;br /&gt;
·       For the active ingredients, country-specific records should be added to the end of the WHO data. The coding and description should follow rules for a particular country.&lt;br /&gt;
&lt;br /&gt;
·       UOMs should be added to the dictionary.who.uom&lt;br /&gt;
&lt;br /&gt;
·       Route of Administration should be added to the dictionary.who.adminroute&lt;br /&gt;
&lt;br /&gt;
= Languages =&lt;br /&gt;
              For current, it is no way to determine ATC and active ingredient data in the national language. This feature will be added soon.&lt;br /&gt;
&lt;br /&gt;
              For dictionary.who.uom and dictionary.who.adminroute it is possible to add data in the national language like to any other dictionary.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
== Component “ATC” ==&lt;br /&gt;
              The “ATC” component is dedicated to selecting ATC codes. Details can be found here &amp;lt;nowiki&amp;gt;http://redmine.inka.in.ua/documents/129&amp;lt;/nowiki&amp;gt;. From November 2022 this component will be deprecated in favor of the “links” component.&lt;br /&gt;
&lt;br /&gt;
Figure 3 ATC component&lt;br /&gt;
&lt;br /&gt;
Figure 4 ATC component configuration&lt;br /&gt;
&lt;br /&gt;
== Component “links” ==&lt;br /&gt;
              The “links” is a universal component that allows adding references to the:&lt;br /&gt;
&lt;br /&gt;
·       Application's data&lt;br /&gt;
&lt;br /&gt;
·       Imported legacy data&lt;br /&gt;
&lt;br /&gt;
·       Imported ATC codes&lt;br /&gt;
&lt;br /&gt;
Details can be found here &amp;lt;nowiki&amp;gt;http://redmine.inka.in.ua/documents/129&amp;lt;/nowiki&amp;gt;. The usage of this component is strongly recommended instead of the ATC component.&lt;br /&gt;
&lt;br /&gt;
Figure 5 Usage of component &amp;quot;links&amp;quot; for active ingredient references&lt;br /&gt;
&lt;br /&gt;
Figure 6 The configuration of the component above&lt;br /&gt;
&lt;br /&gt;
              The value of the field “Name” is “Yes, thus the selection will be copied to literals:&lt;br /&gt;
&lt;br /&gt;
·       prefLabel - selected ingredient&lt;br /&gt;
&lt;br /&gt;
·       description - selected ingredient along with ATC, DDD, and notes&lt;br /&gt;
&lt;br /&gt;
·       atc - ATC code&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=162</id>
		<title>OpenRIMS-RPM - Installation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=162"/>
		<updated>2024-01-25T16:23:59Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
This document describes deployment of OpenRIMS software on a default server.&lt;br /&gt;
&lt;br /&gt;
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.&lt;br /&gt;
&lt;br /&gt;
You should have the ability to install and configure programs and components/services in the selected operating system.&lt;br /&gt;
&lt;br /&gt;
Additionally you need experience on MySQL.&lt;br /&gt;
&lt;br /&gt;
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''&lt;br /&gt;
&lt;br /&gt;
== Overview of Server Requirements ==&lt;br /&gt;
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:&lt;br /&gt;
&lt;br /&gt;
=== Hardware Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Recommendation&lt;br /&gt;
|&lt;br /&gt;
|'''Initial Configuration and Testing Server'''&lt;br /&gt;
|'''Production Server'''&lt;br /&gt;
|-&lt;br /&gt;
|CPU&lt;br /&gt;
|1-2 cores&lt;br /&gt;
|8 cores&lt;br /&gt;
|-&lt;br /&gt;
|Memory&lt;br /&gt;
|At least 2 GB of free RAM&lt;br /&gt;
|At least 16 GB of free RAM&lt;br /&gt;
|-&lt;br /&gt;
|Harddrive&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|-&lt;br /&gt;
|Internet connection&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Operating System&lt;br /&gt;
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
Windows Server 2016 and above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Database:&lt;br /&gt;
|MySQL : Server 5.7 and Workbench 8.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Java:&lt;br /&gt;
|Oracle Java JDK 1.8&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
OpenJDK 1.8&lt;br /&gt;
&lt;br /&gt;
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|OpenRIMS application &amp;amp; database:&lt;br /&gt;
|OpenRIMS Java application binary&lt;br /&gt;
AND&lt;br /&gt;
&lt;br /&gt;
OpenRIMS demo database&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;nowiki&amp;gt;https://github.com/MSH/Pharmadex2/tree/main/database&amp;lt;/nowiki&amp;gt;[1])&lt;br /&gt;
&lt;br /&gt;
''(Please refer to the README.md file)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Google Oauth ID &amp;amp; Secret&lt;br /&gt;
|A Google Mail account for OAuth Login SSO&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== The OpenRIMS Installation Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Prepare to install ===&lt;br /&gt;
1.      Install the following using the respective vendor’s deployment manuals:&lt;br /&gt;
&lt;br /&gt;
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0&lt;br /&gt;
&lt;br /&gt;
1.2.   Java JDK 1.8&lt;br /&gt;
&lt;br /&gt;
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!&lt;br /&gt;
&lt;br /&gt;
''Ubuntu MySQL CLI hint (&amp;lt;code&amp;gt;CREATE DATABASE pdx2&amp;lt;/code&amp;gt;. And restore it: $ &amp;lt;code&amp;gt;mysql -u username -p pdx2 &amp;lt; DumpPdx2.sql&amp;lt;/code&amp;gt;)''&lt;br /&gt;
&lt;br /&gt;
3.      Copy the binary application &amp;lt;code&amp;gt;pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;application.properties&amp;lt;/code&amp;gt; to a dedicated user folder, e.g. /home/{username}/applications/openrims&lt;br /&gt;
&lt;br /&gt;
== Post-Installation OpenRIMS Configurations ==&lt;br /&gt;
&lt;br /&gt;
=== Local TCP/IP port ===&lt;br /&gt;
Adjust the application.properties file for initial configuration as described below.&lt;br /&gt;
&lt;br /&gt;
When initial configuration is concluded you should disable Variables Edit and Cloning of Workflows.&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.url = jdbc:mysql://localhost/'''openrimsre'''?useSSL=false&amp;amp;useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8&amp;amp;'''serverTimezone=Europe/Kiev'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.username = '''username'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.password = '''password'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Logs ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;logging.file.path=/'''home/user/openrimsre/log'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Recommended setting: '''logging.file.path= ./log/'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration it will be necessary to copy Client ID and Client secret to the application.properties&lt;br /&gt;
&lt;br /&gt;
==== OATH2 ====&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-id=client_id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-secret=client_secret&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''SMTP Configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; SMPT Outgoing email settings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.username=NRAemail@gmail.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.password=MyPassword&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow System Edits for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;nowiki&amp;gt;##&amp;lt;/nowiki&amp;gt; Developer Mode Status&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variables.properties.edit=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== '''Allow Cloning of Workflows for initial workflow configuration''' ====&lt;br /&gt;
&amp;lt;code&amp;gt;pharmadex.allow.process.import=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install OpenRIMS as a service ==&lt;br /&gt;
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.&lt;br /&gt;
&lt;br /&gt;
'''Linux'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d&lt;br /&gt;
&lt;br /&gt;
Here are detailed steps for Ubuntu 22.04:&lt;br /&gt;
&lt;br /&gt;
# Copy file .service to /etc/systemd/system: &amp;lt;code&amp;gt;sudo cp openrims.service /etc/systemd/system&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit file .service and change Username '''and''' Execstart path.&lt;br /&gt;
# Start the service: &amp;lt;code&amp;gt;systemctl enable openrims.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change Owner of the java application to your user: &amp;lt;code&amp;gt;sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; OR &amp;lt;code&amp;gt;sudo cdmod 500 pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference here is a sample service file:&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Description=Pharmadex 2 UAT version (madagascar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;After=pharmadex.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;User=ubuntu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SuccessExitStatus=143&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Install]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WantedBy=multi-user.target&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
'''For Windows'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services&lt;br /&gt;
&lt;br /&gt;
== Provide access from the Internet ==&lt;br /&gt;
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2.&lt;br /&gt;
&lt;br /&gt;
The example of virtual server configuration for Apache 2 is in the binary distributive folder named “Linux” on GitHub.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 22.04 and Apache2 here are the steps:&lt;br /&gt;
&lt;br /&gt;
# Copy pharmadex.conf to apache folder e.g. /etc/apache2/sites-available&lt;br /&gt;
# Enable the site a2ensite pharmadex&lt;br /&gt;
Here is another sample Apache conf file with https enabled by [https://www.digitalocean.com/community/tutorials/how-to-use-certbot-standalone-mode-to-retrieve-let-s-encrypt-ssl-certificates-on-ubuntu-20-04 Letsencrypt]:&amp;lt;blockquote&amp;gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
Redirect permanent / &amp;lt;nowiki&amp;gt;https://openrims.yourdomain.com/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
SSLEngine On&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile C:\Certbot\live\openrims.yourdomain.com\fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile C:\Certbot\live\openrims.yourdomain.com\privkey.pem&lt;br /&gt;
&lt;br /&gt;
SSLProtocol         all -SSLv3 -TLSv1 -TLSv1.1&lt;br /&gt;
&lt;br /&gt;
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&lt;br /&gt;
&lt;br /&gt;
SSLHonorCipherOrder on&lt;br /&gt;
&lt;br /&gt;
SSLCompression      off&lt;br /&gt;
&lt;br /&gt;
SSLSessionTickets   off&lt;br /&gt;
&lt;br /&gt;
SSLSessionCacheTimeout  300&lt;br /&gt;
&lt;br /&gt;
ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPass &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPassReverse &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Google Authentication ==&lt;br /&gt;
LINK: See [[OpenRIMS - Installation Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Special Configuration ==&lt;br /&gt;
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''&lt;br /&gt;
----[1] For current, available only to MSH staff&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=161</id>
		<title>OpenRIMS-RPM - Installation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=161"/>
		<updated>2024-01-25T16:08:29Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Post-Installation OpenRIMS Configurations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
This document describes deployment of OpenRIMS software on a default server.&lt;br /&gt;
&lt;br /&gt;
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.&lt;br /&gt;
&lt;br /&gt;
You should have the ability to install and configure programs and components/services in the selected operating system.&lt;br /&gt;
&lt;br /&gt;
Additionally you need experience on MySQL.&lt;br /&gt;
&lt;br /&gt;
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''&lt;br /&gt;
&lt;br /&gt;
== Overview of Server Requirements ==&lt;br /&gt;
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:&lt;br /&gt;
&lt;br /&gt;
=== Hardware Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Recommendation&lt;br /&gt;
|&lt;br /&gt;
|'''Initial Configuration and Testing Server'''&lt;br /&gt;
|'''Production Server'''&lt;br /&gt;
|-&lt;br /&gt;
|CPU&lt;br /&gt;
|1-2 cores&lt;br /&gt;
|8 cores&lt;br /&gt;
|-&lt;br /&gt;
|Memory&lt;br /&gt;
|At least 2 GB of free RAM&lt;br /&gt;
|At least 16 GB of free RAM&lt;br /&gt;
|-&lt;br /&gt;
|Harddrive&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|-&lt;br /&gt;
|Internet connection&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Operating System&lt;br /&gt;
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
Windows Server 2016 and above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Database:&lt;br /&gt;
|MySQL : Server 5.7 and Workbench 8.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Java:&lt;br /&gt;
|Oracle Java JDK 1.8&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
OpenJDK 1.8&lt;br /&gt;
&lt;br /&gt;
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|OpenRIMS application &amp;amp; database:&lt;br /&gt;
|OpenRIMS Java application binary&lt;br /&gt;
AND&lt;br /&gt;
&lt;br /&gt;
OpenRIMS demo database&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;nowiki&amp;gt;https://github.com/MSH/Pharmadex2/tree/main/database&amp;lt;/nowiki&amp;gt;[1])&lt;br /&gt;
&lt;br /&gt;
''(Please refer to the README.md file)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Google Oauth ID &amp;amp; Secret&lt;br /&gt;
|A Google Mail account for OAuth Login SSO&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== The OpenRIMS Installation Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Prepare to install ===&lt;br /&gt;
1.      Install the following using the respective vendor’s deployment manuals:&lt;br /&gt;
&lt;br /&gt;
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0&lt;br /&gt;
&lt;br /&gt;
1.2.   Java JDK 1.8&lt;br /&gt;
&lt;br /&gt;
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!&lt;br /&gt;
&lt;br /&gt;
''Ubuntu MySQL CLI hint (&amp;lt;code&amp;gt;CREATE DATABASE pdx2&amp;lt;/code&amp;gt;. And restore it: $ &amp;lt;code&amp;gt;mysql -u username -p pdx2 &amp;lt; DumpPdx2.sql&amp;lt;/code&amp;gt;)''&lt;br /&gt;
&lt;br /&gt;
3.      Copy the binary application &amp;lt;code&amp;gt;pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;application.properties&amp;lt;/code&amp;gt; to a dedicated user folder, e.g. /home/{username}/applications/openrims&lt;br /&gt;
&lt;br /&gt;
== Post-Installation OpenRIMS Configurations ==&lt;br /&gt;
&lt;br /&gt;
=== Local TCP/IP port ===&lt;br /&gt;
Adjust the application.properties file for initial configuration as described below.&lt;br /&gt;
&lt;br /&gt;
When initial configuration is concluded you should disable Variables Edit and Cloning of Workflows.&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.url = jdbc:mysql://localhost/'''openrimsre'''?useSSL=false&amp;amp;useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8&amp;amp;'''serverTimezone=Europe/Kiev'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.username = '''username'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.password = '''password'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Logs ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;logging.file.path=/'''home/user/openrimsre/log'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Recommended setting: '''logging.file.path= ./log/'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration it will be necessary to copy Client ID and Client secret to the application.properties&lt;br /&gt;
&lt;br /&gt;
==== OATH2 ====&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-id=client_id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-secret=client_secret&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SMTP Configuration'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; SMPT Outgoing email settings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.username=NRAemail@gmail.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.password=MyPassword&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Allow System Edits for initial workflow configuration'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;##&amp;lt;/nowiki&amp;gt; Developer Mode Status&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variables.properties.edit=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Allow Cloning of Workflows for initial workflow configuration'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pharmadex.allow.process.import=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install OpenRIMS as a service ==&lt;br /&gt;
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.&lt;br /&gt;
&lt;br /&gt;
'''Linux'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d&lt;br /&gt;
&lt;br /&gt;
Here are detailed steps for Ubuntu 22.04:&lt;br /&gt;
&lt;br /&gt;
# Copy file .service to /etc/systemd/system: &amp;lt;code&amp;gt;sudo cp openrims.service /etc/systemd/system&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit file .service and change Username '''and''' Execstart path.&lt;br /&gt;
# Start the service: &amp;lt;code&amp;gt;systemctl enable openrims.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change Owner of the java application to your user: &amp;lt;code&amp;gt;sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; OR &amp;lt;code&amp;gt;sudo cdmod 500 pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference here is a sample service file:&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Description=Pharmadex 2 UAT version (madagascar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;After=pharmadex.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;User=ubuntu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SuccessExitStatus=143&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Install]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WantedBy=multi-user.target&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
'''For Windows'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services&lt;br /&gt;
&lt;br /&gt;
== Provide access from the Internet ==&lt;br /&gt;
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2.&lt;br /&gt;
&lt;br /&gt;
The example of virtual server configuration for Apache 2 is in the binary distributive folder named “Linux” on GitHub.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 22.04 and Apache2 here are the steps:&lt;br /&gt;
&lt;br /&gt;
# Copy pharmadex.conf to apache folder e.g. /etc/apache2/sites-available&lt;br /&gt;
# Enable the site a2ensite pharmadex&lt;br /&gt;
Here is another sample Apache conf file with https enabled by [https://www.digitalocean.com/community/tutorials/how-to-use-certbot-standalone-mode-to-retrieve-let-s-encrypt-ssl-certificates-on-ubuntu-20-04 Letsencrypt]:&amp;lt;blockquote&amp;gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
Redirect permanent / &amp;lt;nowiki&amp;gt;https://openrims.yourdomain.com/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
SSLEngine On&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile C:\Certbot\live\openrims.yourdomain.com\fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile C:\Certbot\live\openrims.yourdomain.com\privkey.pem&lt;br /&gt;
&lt;br /&gt;
SSLProtocol         all -SSLv3 -TLSv1 -TLSv1.1&lt;br /&gt;
&lt;br /&gt;
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&lt;br /&gt;
&lt;br /&gt;
SSLHonorCipherOrder on&lt;br /&gt;
&lt;br /&gt;
SSLCompression      off&lt;br /&gt;
&lt;br /&gt;
SSLSessionTickets   off&lt;br /&gt;
&lt;br /&gt;
SSLSessionCacheTimeout  300&lt;br /&gt;
&lt;br /&gt;
ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPass &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPassReverse &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Google Authentication ==&lt;br /&gt;
LINK: See [[OpenRIMS - Installation Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Special Configuration ==&lt;br /&gt;
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''&lt;br /&gt;
----[1] For current, available only to MSH staff&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=160</id>
		<title>OpenRIMS-RPM - Installation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=160"/>
		<updated>2024-01-25T16:06:28Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Post-Installation OpenRIMS Configurations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
This document describes deployment of OpenRIMS software on a default server.&lt;br /&gt;
&lt;br /&gt;
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.&lt;br /&gt;
&lt;br /&gt;
You should have the ability to install and configure programs and components/services in the selected operating system.&lt;br /&gt;
&lt;br /&gt;
Additionally you need experience on MySQL.&lt;br /&gt;
&lt;br /&gt;
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''&lt;br /&gt;
&lt;br /&gt;
== Overview of Server Requirements ==&lt;br /&gt;
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:&lt;br /&gt;
&lt;br /&gt;
=== Hardware Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Recommendation&lt;br /&gt;
|&lt;br /&gt;
|'''Initial Configuration and Testing Server'''&lt;br /&gt;
|'''Production Server'''&lt;br /&gt;
|-&lt;br /&gt;
|CPU&lt;br /&gt;
|1-2 cores&lt;br /&gt;
|8 cores&lt;br /&gt;
|-&lt;br /&gt;
|Memory&lt;br /&gt;
|At least 2 GB of free RAM&lt;br /&gt;
|At least 16 GB of free RAM&lt;br /&gt;
|-&lt;br /&gt;
|Harddrive&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|-&lt;br /&gt;
|Internet connection&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Operating System&lt;br /&gt;
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
Windows Server 2016 and above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Database:&lt;br /&gt;
|MySQL : Server 5.7 and Workbench 8.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Java:&lt;br /&gt;
|Oracle Java JDK 1.8&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
OpenJDK 1.8&lt;br /&gt;
&lt;br /&gt;
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|OpenRIMS application &amp;amp; database:&lt;br /&gt;
|OpenRIMS Java application binary&lt;br /&gt;
AND&lt;br /&gt;
&lt;br /&gt;
OpenRIMS demo database&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;nowiki&amp;gt;https://github.com/MSH/Pharmadex2/tree/main/database&amp;lt;/nowiki&amp;gt;[1])&lt;br /&gt;
&lt;br /&gt;
''(Please refer to the README.md file)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Google Oauth ID &amp;amp; Secret&lt;br /&gt;
|A Google Mail account for OAuth Login SSO&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== The OpenRIMS Installation Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Prepare to install ===&lt;br /&gt;
1.      Install the following using the respective vendor’s deployment manuals:&lt;br /&gt;
&lt;br /&gt;
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0&lt;br /&gt;
&lt;br /&gt;
1.2.   Java JDK 1.8&lt;br /&gt;
&lt;br /&gt;
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!&lt;br /&gt;
&lt;br /&gt;
''Ubuntu MySQL CLI hint (&amp;lt;code&amp;gt;CREATE DATABASE pdx2&amp;lt;/code&amp;gt;. And restore it: $ &amp;lt;code&amp;gt;mysql -u username -p pdx2 &amp;lt; DumpPdx2.sql&amp;lt;/code&amp;gt;)''&lt;br /&gt;
&lt;br /&gt;
3.      Copy the binary application &amp;lt;code&amp;gt;pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;application.properties&amp;lt;/code&amp;gt; to a dedicated user folder, e.g. /home/{username}/applications/openrims&lt;br /&gt;
&lt;br /&gt;
== Post-Installation OpenRIMS Configurations ==&lt;br /&gt;
&lt;br /&gt;
=== Local TCP/IP port ===&lt;br /&gt;
In the application.properties file edit the values marked bold (if it will be necessary):&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.url = jdbc:mysql://localhost/pdx2?useSSL=false&amp;amp;useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8&amp;amp;'''serverTimezone=Europe/Kiev'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.username = '''username'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.password = '''password'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Logs ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;logging.file.path=/'''home/user/pharmadex/log'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Recommended setting: '''logging.file.path= ./log/'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration it will be necessary to copy Client ID and Client secret to the application.properties&lt;br /&gt;
&lt;br /&gt;
==== OATH2 ====&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-id=client_id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-secret=client_secret&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''SMTP Configuration'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; SMPT Outgoing email settings&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.username=NRAemail@gmail.com&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.mail.password=MyPassword&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Allow System Edits for initial workflow configuration'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;##&amp;lt;/nowiki&amp;gt; Developer Mode Status&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variables.properties.edit=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Allow Cloning of Workflows for initial workflow configuration'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pharmadex.allow.process.import=true&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install OpenRIMS as a service ==&lt;br /&gt;
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.&lt;br /&gt;
&lt;br /&gt;
'''Linux'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d&lt;br /&gt;
&lt;br /&gt;
Here are detailed steps for Ubuntu 22.04:&lt;br /&gt;
&lt;br /&gt;
# Copy file .service to /etc/systemd/system: &amp;lt;code&amp;gt;sudo cp openrims.service /etc/systemd/system&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit file .service and change Username '''and''' Execstart path.&lt;br /&gt;
# Start the service: &amp;lt;code&amp;gt;systemctl enable openrims.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change Owner of the java application to your user: &amp;lt;code&amp;gt;sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; OR &amp;lt;code&amp;gt;sudo cdmod 500 pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference here is a sample service file:&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Description=Pharmadex 2 UAT version (madagascar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;After=pharmadex.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;User=ubuntu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SuccessExitStatus=143&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Install]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WantedBy=multi-user.target&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
'''For Windows'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services&lt;br /&gt;
&lt;br /&gt;
== Provide access from the Internet ==&lt;br /&gt;
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2.&lt;br /&gt;
&lt;br /&gt;
The example of virtual server configuration for Apache 2 is in the binary distributive folder named “Linux” on GitHub.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 22.04 and Apache2 here are the steps:&lt;br /&gt;
&lt;br /&gt;
# Copy pharmadex.conf to apache folder e.g. /etc/apache2/sites-available&lt;br /&gt;
# Enable the site a2ensite pharmadex&lt;br /&gt;
Here is another sample Apache conf file with https enabled by [https://www.digitalocean.com/community/tutorials/how-to-use-certbot-standalone-mode-to-retrieve-let-s-encrypt-ssl-certificates-on-ubuntu-20-04 Letsencrypt]:&amp;lt;blockquote&amp;gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
Redirect permanent / &amp;lt;nowiki&amp;gt;https://openrims.yourdomain.com/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
SSLEngine On&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile C:\Certbot\live\openrims.yourdomain.com\fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile C:\Certbot\live\openrims.yourdomain.com\privkey.pem&lt;br /&gt;
&lt;br /&gt;
SSLProtocol         all -SSLv3 -TLSv1 -TLSv1.1&lt;br /&gt;
&lt;br /&gt;
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&lt;br /&gt;
&lt;br /&gt;
SSLHonorCipherOrder on&lt;br /&gt;
&lt;br /&gt;
SSLCompression      off&lt;br /&gt;
&lt;br /&gt;
SSLSessionTickets   off&lt;br /&gt;
&lt;br /&gt;
SSLSessionCacheTimeout  300&lt;br /&gt;
&lt;br /&gt;
ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPass &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPassReverse &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Google Authentication ==&lt;br /&gt;
LINK: See [[OpenRIMS - Installation Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Special Configuration ==&lt;br /&gt;
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''&lt;br /&gt;
----[1] For current, available only to MSH staff&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Implementation_Kickstart_Guide_Part_1&amp;diff=159</id>
		<title>OpenRIMS-RPM - Implementation Kickstart Guide Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Implementation_Kickstart_Guide_Part_1&amp;diff=159"/>
		<updated>2023-12-19T17:19:56Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
Several aspects must be considered before diving into use of OpenRIMS at a Regulatory Authority.&lt;br /&gt;
&lt;br /&gt;
This article will highlight the main aspects and provide links to further information needed to make a good project plan.&lt;br /&gt;
&lt;br /&gt;
== Roles and Responsibilities ==&lt;br /&gt;
First and foremost - OpenRIMS depend on solid, verified and approved Standard Operating Procedures. This cannot be emphasized enough.&lt;br /&gt;
&lt;br /&gt;
These SOPs are controlled by the '''Process Owners'''.&lt;br /&gt;
&lt;br /&gt;
To automate and configure these SOPs in OpenRIMS we have designated '''System Owners'''. They are trained on setting up the Workflows according to the SOPs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Expectation management&lt;br /&gt;
&lt;br /&gt;
Which functions? Which budget is available?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
external dependencies&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Base_Configuration_Part_1&amp;diff=158</id>
		<title>OpenRIMS-RPM - Base Configuration Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Base_Configuration_Part_1&amp;diff=158"/>
		<updated>2023-11-15T17:36:07Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Pharmadex 2 provides true multi-language features. It means that:&lt;br /&gt;
&lt;br /&gt;
1.     The user interface (UI) may be represented in the language selected by a user&lt;br /&gt;
&lt;br /&gt;
2.     A user may use the selected language to fill out on-screen data forms as well as to get documents, reports, etc.&lt;br /&gt;
&lt;br /&gt;
The Pharmadex 2 distribution software allows US English and a national language.&lt;br /&gt;
&lt;br /&gt;
This manual intends for IT experts to help replace the national language provided in the distribution software with the language of a particular country.&lt;br /&gt;
&lt;br /&gt;
To perform this job following IT skills will be needed:&lt;br /&gt;
&lt;br /&gt;
1.     Operation Systems – start and stop Pharmadex 2 service&lt;br /&gt;
&lt;br /&gt;
2.     MySQL database:&lt;br /&gt;
&lt;br /&gt;
3.      Ability to use MySQL Workbench, relation database, and SQL knowledge&lt;br /&gt;
&lt;br /&gt;
4.     MS Excel – ability to use&lt;br /&gt;
&lt;br /&gt;
The roadmap chapter contains a particular example to replace the Nepali language with the Portuguese language. It is possible to define many languages, however, the reasonable choice is two languages. Many languages will slow down Pharmadex 2 and hard to maintain.&lt;br /&gt;
&lt;br /&gt;
Refer to Annex 1 for the troubleshooting.&lt;br /&gt;
&lt;br /&gt;
Annex 2 contains technical data that may be useful to understand how it works “under the stage”.&lt;br /&gt;
&lt;br /&gt;
Annex 3 contains directions on how to maintain labels and messages in the actual state&lt;br /&gt;
&lt;br /&gt;
= 1        Pre-request =&lt;br /&gt;
·       Direct access to Pharmadex 2 server computer console with administrative privileges&lt;br /&gt;
&lt;br /&gt;
·       Supervisor’s access rights to Pharmadex 2&lt;br /&gt;
&lt;br /&gt;
·       The MySQL Workbench is installed and a connection to the Pharmadex 2 database is defined. The rights should be at least query/update&lt;br /&gt;
&lt;br /&gt;
·       The MS Excel released after 2017 is installed&lt;br /&gt;
&lt;br /&gt;
·       The MySQL for Excel plugin is installed, see  &amp;lt;nowiki&amp;gt;https://downloads.mysql.com/archives/excel/&amp;lt;/nowiki&amp;gt;[1]&lt;br /&gt;
&lt;br /&gt;
= 2        The roadmap =&lt;br /&gt;
1.     Stop Pharmadex 2 server&lt;br /&gt;
&lt;br /&gt;
2.     Create a backup copy of the database&lt;br /&gt;
&lt;br /&gt;
3.     Determine languages that are in use&lt;br /&gt;
&lt;br /&gt;
4.     Upload to MS Excel messages for English US language and translate them&lt;br /&gt;
&lt;br /&gt;
5.     Add a new language:&lt;br /&gt;
&lt;br /&gt;
5.1.  Register a new language in the database&lt;br /&gt;
&lt;br /&gt;
5.2.  Remove an excess language&lt;br /&gt;
&lt;br /&gt;
5.3.  Insert messages in the new language into the database&lt;br /&gt;
&lt;br /&gt;
5.4.  Replace the language tag in the demo examples&lt;br /&gt;
&lt;br /&gt;
6.     Start Pharmadex 2 and test the new language&lt;br /&gt;
&lt;br /&gt;
7.     Replace logos&lt;br /&gt;
&lt;br /&gt;
8.     Fine-tune tiles&lt;br /&gt;
&lt;br /&gt;
== 2.1       Stop Pharmadex 2 server ==&lt;br /&gt;
              For MS Windows installation stop the Pharmadex 2 service using the Services tool. Refer to MS Windows documentation for details. The most used tool is “services.msc”.&lt;br /&gt;
&lt;br /&gt;
              For Linux installation stop the Pharmadex 2 service. Refer to the appropriate Linux documentation for details. The most used tool is “systemctl”.&lt;br /&gt;
&lt;br /&gt;
== 2.2       Create a backup copy of the database ==&lt;br /&gt;
Use MySQL Workbench to create a backup copy of the database. Refer to the MySQL workbench manual for details.&lt;br /&gt;
&lt;br /&gt;
Figure 1 Backup dump creation&lt;br /&gt;
&lt;br /&gt;
== 2.3       Determine languages that are in use ==&lt;br /&gt;
              Use MySQL Workbench connection to Pharmadex 2 database to execute a query&lt;br /&gt;
&lt;br /&gt;
SELECT ID, `locale`, `displayname` FROM pdx2.resource_bundle;&lt;br /&gt;
&lt;br /&gt;
Figure 2 Nepali and English US are in use&lt;br /&gt;
&lt;br /&gt;
              '''In this particular example, the Nepali language should be removed. The Portuguese language should be added.'''&lt;br /&gt;
&lt;br /&gt;
== 2.4       Upload to MS Excel messages in English US and translate them ==&lt;br /&gt;
As we determine above (3), the English US language ID is 3. Use MySQL Workbench connection to Pharmadex 2 database to select all messages in English&lt;br /&gt;
&lt;br /&gt;
Query is SELECT * FROM pdx2.resource_message where key_bundle=3&lt;br /&gt;
&lt;br /&gt;
Figure 3 Select all messages in English US  (key_bundle=3)&lt;br /&gt;
&lt;br /&gt;
Figure 4 Select all records from the result&lt;br /&gt;
&lt;br /&gt;
Figure 5. Insert records to MS Excel sheet&lt;br /&gt;
&lt;br /&gt;
Figure 6 Translate them (e.g., to Portuguese)&lt;br /&gt;
&lt;br /&gt;
== 2.5       Add a new language ==&lt;br /&gt;
&lt;br /&gt;
=== 2.5.1       Register a new language in the database ===&lt;br /&gt;
Prepare image of countries flag as SVG file.&lt;br /&gt;
&lt;br /&gt;
Use MySQL Workbench to add a new record into table pdx2.resource_bundle. Fields NmraLogo, and UsaidLogo should be filled with space, not NULL&lt;br /&gt;
&lt;br /&gt;
Figure 7 The Portuguese language has been registered&lt;br /&gt;
&lt;br /&gt;
=== 2.5.2      Remove an excess language ===&lt;br /&gt;
              Use MySQL Workbench to remove the Nepali language registration record from the database. All messages in the Nepali language will be removed as well.&lt;br /&gt;
&lt;br /&gt;
Figure 8 Nepali language bundle is going to be removed&lt;br /&gt;
&lt;br /&gt;
             &lt;br /&gt;
&lt;br /&gt;
=== 2.5.3      Insert messages in the new language into the database ===&lt;br /&gt;
              Open the Excel file prepared in 4 and fill out the rightmost column (D) by the ID of the new registered language - 4&lt;br /&gt;
&lt;br /&gt;
Figure 9 Fill out the column D for key_bundle with the key bundle for a new language  (4)&lt;br /&gt;
&lt;br /&gt;
Figure 10 Use MySQL for Excel plugin to insert messages, refer to the plugin’s manual&lt;br /&gt;
&lt;br /&gt;
Figure 11 Define column mapping&lt;br /&gt;
&lt;br /&gt;
Figure 12 Append them&lt;br /&gt;
&lt;br /&gt;
=== 2.5.4      Replace language tag in existing workflow configurations ===&lt;br /&gt;
The distribution database contains demonstration workflows. Their configurations are defined in the old language. Use MySQL workbench to replace language tags in the configuration.&lt;br /&gt;
&lt;br /&gt;
The script below will replace the language tag “ne_NP” with “pt_BR”. Modify it for the actual languages&lt;br /&gt;
&lt;br /&gt;
UPDATE `pdx2`.`concept` c SET `Identifier` = 'pt_BR'&lt;br /&gt;
&lt;br /&gt;
where c.Identifier='ne_NP'&lt;br /&gt;
&lt;br /&gt;
= 3        Start Pharmadex 2 and test the new language =&lt;br /&gt;
              For MS Windows installation start the Pharmadex 2 service using the Services tool. Refer to MS Windows documentation for details. The most used tool is “services.msc”.&lt;br /&gt;
&lt;br /&gt;
              For Linux installation start the Pharmadex 2 service. Refer to appropriative  Linux documentation for details. The most used tool is “systemctl”.&lt;br /&gt;
&lt;br /&gt;
Figure 13 New language is available&lt;br /&gt;
&lt;br /&gt;
= 4        Replace logos =&lt;br /&gt;
Figure 14 Feature Administrate-Configurations-Resources allows uploading logos. Use language switch to upload logos for any given language separately.&lt;br /&gt;
&lt;br /&gt;
= 5        Fine-tune tiles =&lt;br /&gt;
Figure 15 Administrate, Configuration, Tiles, tick-up on the tile group in the table&lt;br /&gt;
&lt;br /&gt;
Figure 16 Administrate page tiles as an example. Click on “Administrate” in the left table for the next screen&lt;br /&gt;
&lt;br /&gt;
Figure 17 Elements available for internationalization&lt;br /&gt;
&lt;br /&gt;
1.     Select the language using the language switch&lt;br /&gt;
&lt;br /&gt;
2.     Fill out this information using the language selected&lt;br /&gt;
&lt;br /&gt;
3.     It is possible to select another picture from a tile&lt;br /&gt;
&lt;br /&gt;
4.     This label should be in the language selected&lt;br /&gt;
&lt;br /&gt;
= 6        Annex 1 Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
== 6.1       The new language doesn’t appear in the language selector ==&lt;br /&gt;
Check table resource_bundle. If the new language is present, restart Pharmadex 2 server. Otherwise, add new language exactly as described in the Roadmap chapter.&lt;br /&gt;
&lt;br /&gt;
== 6.2       The labels in new languages appear improperly ==&lt;br /&gt;
The messages on the selected language appears improperly like 'new_chemical_entity', or 'UserType.TIPC'.&lt;br /&gt;
&lt;br /&gt;
The messages for the language selected are not defined. Suppose it is Portuguese.  To check it:&lt;br /&gt;
&lt;br /&gt;
Execute SELECT * FROM pdx2.resource_bundle;&lt;br /&gt;
&lt;br /&gt;
Figure 18 The Portuguese language is registered. ID is 4&lt;br /&gt;
&lt;br /&gt;
              Execute SELECT * FROM pdx2.resource_message where key_bundle=4&lt;br /&gt;
&lt;br /&gt;
Figure 19 For the Portuguese language messages are not defined&lt;br /&gt;
&lt;br /&gt;
              Insert messages from MS Excel as described in 4.3&lt;br /&gt;
&lt;br /&gt;
== 6.3       The labels for the new language appear in the old language ==&lt;br /&gt;
The ID field in table resource_bundle does not match the ID in resource_message.&lt;br /&gt;
&lt;br /&gt;
To check it, execute SQL queries from 8.2. The resource_message table should contain messages in the wrong language&lt;br /&gt;
&lt;br /&gt;
Figure 20 Messages in English, despite the Portuguese language&lt;br /&gt;
&lt;br /&gt;
              To fix it restore the database from backup and repeat the new language definition. Step, described in chapter 4, may be omitted.&lt;br /&gt;
&lt;br /&gt;
== 6.4       The SVG logo or flag in the language selector doesn’t appear ==&lt;br /&gt;
Open the SVG file locally by browser or lnkscape (&amp;lt;nowiki&amp;gt;https://inkscape.org/&amp;lt;/nowiki&amp;gt;). If the file is consistent, re-import it to the database using the “value editor” feature.&lt;br /&gt;
&lt;br /&gt;
Figure 21 Right-click and Open Value in Editor&lt;br /&gt;
&lt;br /&gt;
Figure 22 The SVG file is a text. Insert it into the Value Editor&lt;br /&gt;
&lt;br /&gt;
= 7        Annex 2 Technical implementation =&lt;br /&gt;
              The internationalization of the user interfaces is grounded on Java i18N approach[2].&lt;br /&gt;
&lt;br /&gt;
              Textual labels and messages are available directly in the database tables:&lt;br /&gt;
&lt;br /&gt;
1.     resource_bundle – keeps languages definitions.&lt;br /&gt;
&lt;br /&gt;
2.     resource_message – keeps textual labels and messages&lt;br /&gt;
&lt;br /&gt;
Each row in the resource_bundle represents a language. Columns are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Column'''&lt;br /&gt;
|'''Purpose'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|Id&lt;br /&gt;
|Unique key  for a language definition&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|sortOrder&lt;br /&gt;
|Order to use in the user interface. The 0  is the highest priority, the rest are the lowest. For more details see  chapter “Language by default” below&lt;br /&gt;
|0 – the default language&lt;br /&gt;
|-&lt;br /&gt;
|basename&lt;br /&gt;
|For compatibility with the previous  release. Should be unique for a language&lt;br /&gt;
|English&lt;br /&gt;
|-&lt;br /&gt;
|locale&lt;br /&gt;
|Locale ID for a language. Please, put  attention to _ (underscore), instead of – (dash) usage. It is to be  compatible with java.util.Locale.toString[3]&lt;br /&gt;
|en_US&lt;br /&gt;
|-&lt;br /&gt;
|displayName&lt;br /&gt;
|Human-readable name of the language&lt;br /&gt;
|לשון עבר&lt;br /&gt;
|-&lt;br /&gt;
|svgFlag&lt;br /&gt;
|Flag to represent the language in the user  interface. Must be defined.&lt;br /&gt;
|&amp;lt;?XML version=&amp;quot;1.0&amp;quot;  encoding=&amp;quot;iso-8859-1&amp;quot;?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Generator: Adobe Illustrator…&lt;br /&gt;
|-&lt;br /&gt;
|updatedDate&lt;br /&gt;
|Not used in  Pharmadex 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|createdDate&lt;br /&gt;
|Not used in  Pharmadex 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|UsaidLogo&lt;br /&gt;
|Not used in  Pharmadex 2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|NmraLogo&lt;br /&gt;
|Not used in  Pharmadex 2&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              Each row in resource_message table represents a text on the language as key-value pair:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Column'''&lt;br /&gt;
|'''Purpose'''&lt;br /&gt;
|'''Example'''&lt;br /&gt;
|-&lt;br /&gt;
|id&lt;br /&gt;
|Unique key  for a text in a language&lt;br /&gt;
|5376&lt;br /&gt;
|-&lt;br /&gt;
|message_key&lt;br /&gt;
|Unique  language - independent key for a text&lt;br /&gt;
|global_cancel&lt;br /&gt;
|-&lt;br /&gt;
|message_value&lt;br /&gt;
|Value in a  language&lt;br /&gt;
|Cancel&lt;br /&gt;
|-&lt;br /&gt;
|key_bundle&lt;br /&gt;
|Id in  resource_bundle to link to the language&lt;br /&gt;
|3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
       The Pharmadex 2 database allows defining multi-language classifiers (dictionaries) as well as files to upload (resources). When a user selects a language, the Pharmadex 2 switches the language of the user interface, dictionaries, and resources. Thus, a user can fill out the application electronic form in the language selected.&lt;br /&gt;
&lt;br /&gt;
When a user fills application electronic form, Pharmadex 2 stores user input for each language separately. Suppose the form in Portuguese&lt;br /&gt;
&lt;br /&gt;
'''Fator de forma''': [Caixa Cinza]     &lt;br /&gt;
&lt;br /&gt;
              When a user will switch to English it will be:&lt;br /&gt;
&lt;br /&gt;
'''Form factor:''' [Caixa Cinza]&lt;br /&gt;
&lt;br /&gt;
              It is possible to change the data in the English form&lt;br /&gt;
&lt;br /&gt;
'''Form factor:''' [Gray Box]&lt;br /&gt;
&lt;br /&gt;
              The Portuguese form will still keep&lt;br /&gt;
&lt;br /&gt;
'''Fator de forma''': [Caixa Cinza]&lt;br /&gt;
&lt;br /&gt;
       The English form will keep:&lt;br /&gt;
&lt;br /&gt;
'''Form factor:''' [Gray Box]&lt;br /&gt;
&lt;br /&gt;
              The true multi-language is a powerful, however costly feature:&lt;br /&gt;
&lt;br /&gt;
·       The database should keep and process more data.&lt;br /&gt;
&lt;br /&gt;
·       The data in the database is complex, because of the necessity to keep language for any data element&lt;br /&gt;
&lt;br /&gt;
·       The initial input and maintenance of multi-language dictionaries and resources are costly   &lt;br /&gt;
&lt;br /&gt;
The two languages are the optimal choice.       &lt;br /&gt;
&lt;br /&gt;
= 8        Annex 3 Maintenance and language by default =&lt;br /&gt;
Figure 23 Feature Administrate-Configurations-Messages allows changing initial uploaded labels and messages as well as adding missed ones&lt;br /&gt;
&lt;br /&gt;
              When a user enters Pharmadex first time, the system proposed a language that is defined in the file “application.properties” under the key spring.web.locale, e.g., “spring.web.locale=en_US”. It is recommended not re-define this key to the local language because some browsers will not accept the local language, thus Pharmadex 2 will be inaccessible.&lt;br /&gt;
&lt;br /&gt;
              When a user selects a language, this selection will be stored in the file cookie on the user’s computer. All follow-up calls will set the selected language. The time to live the selection is a year or until a user will switch to another language.&lt;br /&gt;
&lt;br /&gt;
----[1] This plugin is out of support for now. Despite this it is available yet. The MS Excel export-import features will be implemented in Pharmadex 2 ASAP.&lt;br /&gt;
&lt;br /&gt;
[2] &amp;lt;nowiki&amp;gt;https://docs.oracle.com/javase/8/docs/technotes/guides/intl/index.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[3] &amp;lt;nowiki&amp;gt;https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html#toString()&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=Main_Page&amp;diff=157</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=Main_Page&amp;diff=157"/>
		<updated>2023-10-26T20:22:27Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Welcome! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Welcome!''' ==&lt;br /&gt;
This site supports the installation, deployment and full documentation of OpenRIMS modules for Registration Process Management (RPM) and Pharmacovigilance Management (PVM).&lt;br /&gt;
&lt;br /&gt;
Information on this site is provided under Creative Commons standards: https://creativecommons.org/licenses/by/4.0/&lt;br /&gt;
&lt;br /&gt;
=== '''Navigation &amp;amp; Language''' ===&lt;br /&gt;
Please click here to see an index of all content of this Wiki: https://wiki.openrims.org/index.php/Special:AllPages&lt;br /&gt;
&lt;br /&gt;
To change language please open this website in Google Chrome and then Right Click to select Translate to select a different language. The Wiki use Google Translate which might not always be 100% accurate.&lt;br /&gt;
&lt;br /&gt;
=== '''What is a RIMS?''' ===&lt;br /&gt;
The purpose of a Regulatory Information Management System (RIMS) is to automate and digitalize the processes and work routines at a National Medicines Regulatory Authority (NMRA).&lt;br /&gt;
&lt;br /&gt;
OpenRIMS serves that purpose and is built on [[Common Standards for RIMS]].&lt;br /&gt;
&lt;br /&gt;
=== Localization ===&lt;br /&gt;
OpenRIMS is Free and Open Source Software (FOSS) and can from the browser be localized to country procedures and needs like language. &lt;br /&gt;
&lt;br /&gt;
=== '''Getting Started''' ===&lt;br /&gt;
* [[OpenRIMS-RPM - Installation Part 1|OpenRIMS-RPM Installation/Deployment Part 1]]&lt;br /&gt;
* [[OpenRIMS - Installation Part 2|OpenRIMS-RPM Installation/Deployment Part 2]]&lt;br /&gt;
* [[OpenRIMS - User Management|OpenRIMS User Management]]&lt;br /&gt;
* [[OpenRIMS - Workflows Part 1|OpenRIMS Workflow Configuration]]&lt;br /&gt;
* [[OpenRIMS - Reporting Google Part 1|OpenRIMS and Google Looker Studio]]&lt;br /&gt;
&lt;br /&gt;
=== '''The Common Regulatory Function Examples''' ===&lt;br /&gt;
* OpenRIMS-RPM - M2 - Marketing Authorization - Coming Soon!&lt;br /&gt;
* OpenRIMS-PVM - M3 - Pharmacovigilance - Coming Soon!&lt;br /&gt;
* OpenRIMS-RPM - M4 - Import/Export Certificates - Coming Soon!&lt;br /&gt;
* OpenRIMS-RPM - M5 - Premises and People Registration - Coming Soon!&lt;br /&gt;
* OpenRIMS-RPM - M6 - Inspection - Coming Soon!&lt;br /&gt;
* OpenRIMS-RPM - M8 - Clinical Trial Approval - Coming Soon!&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
=== '''Making content contributions - Currently Not Available!!''' ===&lt;br /&gt;
'''PLEASE NOTE!'''&lt;br /&gt;
&lt;br /&gt;
Use the following syntax to name the pages:&lt;br /&gt;
&lt;br /&gt;
''&amp;quot;System name&amp;quot;_&amp;quot;Page/Subject Title&amp;quot;_&amp;quot;Part Number&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
'''OpenRIMS_Cleaning the Database_Part 1'''&lt;br /&gt;
&lt;br /&gt;
All new content is subject to review and approval.&lt;br /&gt;
&lt;br /&gt;
OpenRIMS reserves the right to edit or delete content or pages as appropriate if the content is not relevant for Regulatory Information Management Systems.&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=156</id>
		<title>OpenRIMS-RPM - Installation Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Installation_Part_1&amp;diff=156"/>
		<updated>2023-09-26T13:45:32Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Hardware Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Purpose ==&lt;br /&gt;
This document describes deployment of OpenRIMS software on a default server.&lt;br /&gt;
&lt;br /&gt;
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.&lt;br /&gt;
&lt;br /&gt;
You should have the ability to install and configure programs and components/services in the selected operating system.&lt;br /&gt;
&lt;br /&gt;
Additionally you need experience on MySQL.&lt;br /&gt;
&lt;br /&gt;
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''&lt;br /&gt;
&lt;br /&gt;
== Overview of Server Requirements ==&lt;br /&gt;
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:&lt;br /&gt;
&lt;br /&gt;
=== Hardware Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Recommendation&lt;br /&gt;
|&lt;br /&gt;
|'''Initial Configuration and Testing Server'''&lt;br /&gt;
|'''Production Server'''&lt;br /&gt;
|-&lt;br /&gt;
|CPU&lt;br /&gt;
|1-2 cores&lt;br /&gt;
|8 cores&lt;br /&gt;
|-&lt;br /&gt;
|Memory&lt;br /&gt;
|At least 2 GB of free RAM&lt;br /&gt;
|At least 16 GB of free RAM&lt;br /&gt;
|-&lt;br /&gt;
|Harddrive&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|At least 10GB of free SDD/HDD&lt;br /&gt;
|-&lt;br /&gt;
|Internet connection&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|Should align with minimal requirements for Google Mail&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Software Requirements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Operating System&lt;br /&gt;
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
Windows Server 2016 and above&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Database:&lt;br /&gt;
|MySQL : Server 5.7 and Workbench 8.0&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Java:&lt;br /&gt;
|Oracle Java JDK 1.8&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
OpenJDK 1.8&lt;br /&gt;
&lt;br /&gt;
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|OpenRIMS application &amp;amp; database:&lt;br /&gt;
|OpenRIMS Java application binary&lt;br /&gt;
AND&lt;br /&gt;
&lt;br /&gt;
OpenRIMS demo database&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;nowiki&amp;gt;https://github.com/MSH/Pharmadex2/tree/main/database&amp;lt;/nowiki&amp;gt;[1])&lt;br /&gt;
&lt;br /&gt;
''(Please refer to the README.md file)''&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Google Oauth ID &amp;amp; Secret&lt;br /&gt;
|A Google Mail account for OAuth Login SSO&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== The OpenRIMS Installation Procedure ==&lt;br /&gt;
&lt;br /&gt;
=== Prepare to install ===&lt;br /&gt;
1.      Install the following using the respective vendor’s deployment manuals:&lt;br /&gt;
&lt;br /&gt;
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0&lt;br /&gt;
&lt;br /&gt;
1.2.   Java JDK 1.8&lt;br /&gt;
&lt;br /&gt;
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!&lt;br /&gt;
&lt;br /&gt;
''Ubuntu MySQL CLI hint (&amp;lt;code&amp;gt;CREATE DATABASE pdx2&amp;lt;/code&amp;gt;. And restore it: $ &amp;lt;code&amp;gt;mysql -u username -p pdx2 &amp;lt; DumpPdx2.sql&amp;lt;/code&amp;gt;)''&lt;br /&gt;
&lt;br /&gt;
3.      Copy the binary application &amp;lt;code&amp;gt;pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;application.properties&amp;lt;/code&amp;gt; to a dedicated user folder, e.g. /home/{username}/applications/openrims&lt;br /&gt;
&lt;br /&gt;
== Post-Installation OpenRIMS Configurations ==&lt;br /&gt;
&lt;br /&gt;
=== Local TCP/IP port ===&lt;br /&gt;
In the application.properties file edit the values marked bold (if it will be necessary):&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.url = jdbc:mysql://localhost/pdx2?useSSL=false&amp;amp;useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;characterSetResults=UTF-8&amp;amp;'''serverTimezone=Europe/Kiev'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.username = '''username'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.datasource.password = '''password'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Logs ====&lt;br /&gt;
In the application.properties file edit the values marked bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;logging.file.path=/'''home/user/pharmadex/log'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Recommended setting: '''logging.file.path= ./log/'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After configuration it will be necessary to copy Client ID and Client secret to the application.properties&lt;br /&gt;
&lt;br /&gt;
==== OATH2 ====&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-id=client_id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;spring.security.oauth2.client.registration.google.client-secret=client_secret&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install OpenRIMS as a service ==&lt;br /&gt;
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.&lt;br /&gt;
&lt;br /&gt;
'''Linux'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d&lt;br /&gt;
&lt;br /&gt;
Here are detailed steps for Ubuntu 22.04:&lt;br /&gt;
&lt;br /&gt;
# Copy file .service to /etc/systemd/system: &amp;lt;code&amp;gt;sudo cp openrims.service /etc/systemd/system&amp;lt;/code&amp;gt;&lt;br /&gt;
# Edit file .service and change Username '''and''' Execstart path.&lt;br /&gt;
# Start the service: &amp;lt;code&amp;gt;systemctl enable openrims.service&amp;lt;/code&amp;gt;&lt;br /&gt;
# Change Owner of the java application to your user: &amp;lt;code&amp;gt;sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt; OR &amp;lt;code&amp;gt;sudo cdmod 500 pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reference here is a sample service file:&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Description=Pharmadex 2 UAT version (madagascar)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;After=pharmadex.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;User=ubuntu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SuccessExitStatus=143&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[Install]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WantedBy=multi-user.target&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
'''For Windows'''&lt;br /&gt;
&lt;br /&gt;
The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services&lt;br /&gt;
&lt;br /&gt;
== Provide access from the Internet ==&lt;br /&gt;
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2.&lt;br /&gt;
&lt;br /&gt;
The example of virtual server configuration for Apache 2 is in the binary distributive folder named “Linux” on GitHub.&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 22.04 and Apache2 here are the steps:&lt;br /&gt;
&lt;br /&gt;
# Copy pharmadex.conf to apache folder e.g. /etc/apache2/sites-available&lt;br /&gt;
# Enable the site a2ensite pharmadex&lt;br /&gt;
Here is another sample Apache conf file with https enabled by [https://www.digitalocean.com/community/tutorials/how-to-use-certbot-standalone-mode-to-retrieve-let-s-encrypt-ssl-certificates-on-ubuntu-20-04 Letsencrypt]:&amp;lt;blockquote&amp;gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
Redirect permanent / &amp;lt;nowiki&amp;gt;https://openrims.yourdomain.com/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ServerName openrims.yourdomain.com&lt;br /&gt;
&lt;br /&gt;
SSLEngine On&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile C:\Certbot\live\openrims.yourdomain.com\fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile C:\Certbot\live\openrims.yourdomain.com\privkey.pem&lt;br /&gt;
&lt;br /&gt;
SSLProtocol         all -SSLv3 -TLSv1 -TLSv1.1&lt;br /&gt;
&lt;br /&gt;
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256&lt;br /&gt;
&lt;br /&gt;
SSLHonorCipherOrder on&lt;br /&gt;
&lt;br /&gt;
SSLCompression      off&lt;br /&gt;
&lt;br /&gt;
SSLSessionTickets   off&lt;br /&gt;
&lt;br /&gt;
SSLSessionCacheTimeout  300&lt;br /&gt;
&lt;br /&gt;
ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPass &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ProxyPassReverse &amp;lt;nowiki&amp;gt;http://192.168.1.10:8084/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring Google Authentication ==&lt;br /&gt;
LINK: See [[OpenRIMS - Installation Part 2]]&lt;br /&gt;
&lt;br /&gt;
== Special Configuration ==&lt;br /&gt;
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''&lt;br /&gt;
----[1] For current, available only to MSH staff&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_User_Manual_Chapter_5&amp;diff=155</id>
		<title>OpenRIMS-PVM - User Manual Chapter 5</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_User_Manual_Chapter_5&amp;diff=155"/>
		<updated>2023-09-12T15:51:42Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* 1.8.4       Downloading a Dataset for Further Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Analytical Portal =&lt;br /&gt;
At the '''Home Page''' of the Analytical Portal''',''' you will be presented with the following options:&lt;br /&gt;
&lt;br /&gt;
●     Spontaneous and Active Reports&lt;br /&gt;
&lt;br /&gt;
●     Spontaneous and Active Analyzer &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|The  analytical portal is the centralized hub for causative drug assessment using  traditional recognized rating scales, standardized terminology, and risk  detection with exposed versus non-exposed risk ratios.&lt;br /&gt;
&lt;br /&gt;
'''Note''': the following roles have access to the analytical  portal: &lt;br /&gt;
&lt;br /&gt;
·          '''Administrator.''' The  administrator has FULL permissions to the analytical portal.&lt;br /&gt;
&lt;br /&gt;
·          '''Analyst.''' An  analytics user is able to assign terminology, set causality and run analysis  on collected data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Click on the    user profile menu option which appears when clicking on the profile icon to    view roles and facilities you currently have access to.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Spontaneous Reporting ==&lt;br /&gt;
Spontaneous reports are termed spontaneous as they take place during the clinician’s normal diagnostic appraisal of a patient, when the clinician is drawing the conclusion that the drug may be implicated in the causality of the event.&lt;br /&gt;
&lt;br /&gt;
Spontaneous reporting system relies on vigilant physicians, other healthcare professionals, and patients who not only generate a suspicion of an ADR, but also report it.&lt;br /&gt;
&lt;br /&gt;
It is an important source of regulatory actions such as taking a drug off the market or a label change due to safety problems. Spontaneous reporting is the core data-generating system of international pharmacovigilance, relying on healthcare professionals (and, in some countries, consumers) to identify and report any adverse events to their national pharmacovigilance center.&lt;br /&gt;
&lt;br /&gt;
Spontaneous reports are, by definition, submitted voluntarily.&lt;br /&gt;
&lt;br /&gt;
PViMS facilitates a public facing interface that allows clinicians or the public itself to spontaneously report on adverse event related data. See chapter 8 for more information.&lt;br /&gt;
&lt;br /&gt;
== Active Reporting ==&lt;br /&gt;
Active surveillance for monitoring the safety and effectiveness of medical products is increasingly recognized as a complement to spontaneous reporting commonly used by pharmacovigilance systems. Integrated mechanisms and processes for monitoring the safety of medicines are essential to a well-functioning pharmaceutical sector. A positive benefit-to-risk balance should precede access to market; however, most regulatory decisions take place early in the product lifecycle and are based on limited data from clinical trials that may be of relatively short duration with limited numbers and types of subjects.&lt;br /&gt;
&lt;br /&gt;
It is critical, therefore, that medicines continue to be monitored for safety and effectiveness once they enter the market under real-life conditions. For some medicines, issues will only emerge under real-world conditions as a result of prolonged use, use in specific subpopulations or in patients with multiple comorbidities, or use in combination with other medicines. In some cases, rare adverse effects only emerge after a product is used for many years, by large numbers of patients, or both.&lt;br /&gt;
&lt;br /&gt;
Active surveillance is particularly important to support the introduction of new essential medicines in LMICs whose regulatory systems are being developed and are in need of support. In resource-limited settings, active surveillance can help determine the real-life frequency, risk factors, and impact of clinically significant adverse medicine events on treatment outcomes. &lt;br /&gt;
&lt;br /&gt;
== Pharmacovigilance Activities ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|This section describes the common  processes adopted by the pharmacovigilance unit in responding to both  spontaneous and active reports submitted through PViMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''PLEASE  NOTE:''' In relation to spontaneous reports,  the patient identified in the report does '''NOT''' form part of the active reporting patient dataset. Therefore,  spontaneous reports do not form part of any analysis conducted through the analyzer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following activities are facilitated  in the Analytical portal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·          Verify quality  of report data&lt;br /&gt;
&lt;br /&gt;
·          Set terminology  for adverse drug reaction (MedDRA)&lt;br /&gt;
&lt;br /&gt;
·          Set causality  per drug (Naranjo or WHO)&lt;br /&gt;
&lt;br /&gt;
·          Create and  update E2B files (Export to XML)&lt;br /&gt;
&lt;br /&gt;
·          Generate a  patient summary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Terminology ====&lt;br /&gt;
'''Causality Assessment Scale or Terms.''' The assessment scales or terms were developed to help standardize assessment of causality for all adverse drug reactions. The result is determined by an algorithm designed by Naranjo or WHO for determining the likelihood of whether an adverse drug event is actually due to the drug rather than the result of other factors. Probability is assigned via a score termed definite, probable, possible or doubtful (Naranjo) or certain, probable/likely, possible, unlikely, conditional, unassessable or unclassified (WHO). Values obtained from this algorithm are sometimes used in peer reviews to verify the validity of author's conclusions regarding adverse drug reactions.&lt;br /&gt;
&lt;br /&gt;
'''MedDRA Terminology'''. MedDRA or Medical Dictionary for Regulatory Activities is a clinically validated international medical terminology dictionary by regulatory authorities in the pharmaceutical industry during the regulatory process, from pre-marketing to post-marketing activities, and for data entry, retrieval, evaluation, and presentation. In addition, it is the adverse event classification dictionary endorsed by the International Conference on Harmonization of Technical Requirements for Registration of Pharmaceuticals for Human Use (ICH). &lt;br /&gt;
&lt;br /&gt;
'''E2B'''. The international standard for transmitting medicine adverse event reports specified by the ICH.&lt;br /&gt;
&lt;br /&gt;
==== 1.3.2       Process Flow ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Activity: Start of Process'''&lt;br /&gt;
&lt;br /&gt;
Clinician adds  a new adverse event to the patient record.&lt;br /&gt;
&lt;br /&gt;
Reporter adds a  new spontaneous report.&lt;br /&gt;
&lt;br /&gt;
System generates a new report for the PV  unit to action:&lt;br /&gt;
&lt;br /&gt;
* Report has a unique identifier&lt;br /&gt;
* Report has a default activity of '''Confirm Report Data'''&lt;br /&gt;
* Report has a sub status of '''UNCONFIRMED'''&lt;br /&gt;
|'''Confirm Report Data'''&lt;br /&gt;
&lt;br /&gt;
The purpose of  this activity is to facilitate the checking, vetting, and updating of the  clinical data collected for the adverse event logged. The PV unit will be  unable to perform any causality or terminology configurations until the data  is confirmed as accurate and comprehensive.&lt;br /&gt;
&lt;br /&gt;
The PV specialist  has the following options: &lt;br /&gt;
&lt;br /&gt;
* Delete Report&lt;br /&gt;
* Confirm Report&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |'''Activity: Confirm Report Data'''&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' PV specialist and  clinician/reporter update clinical data until there is sufficient information  to perform causality and terminology configurations.&lt;br /&gt;
&lt;br /&gt;
For active reporting the patient record is modified  through the clinical portal.&lt;br /&gt;
&lt;br /&gt;
For spontaneous reporting the report is modified  directly in the analytical portal.&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' Once data has  been confirmed, the PV specialist will confirm the report is ready for assessment  by selecting the Confirm report option.&lt;br /&gt;
&lt;br /&gt;
'''Step 3:''' The report is moved into a  new activity: Set MedDRA and Causality.&lt;br /&gt;
|-&lt;br /&gt;
|'''Activity: Set MedDRA and  Causality'''&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' PV specialist sets  the terminology for the adverse event. This will be the terminology used for analysis  purposes.&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' PV specialist then  sets the causality per medication that was in use at the onset date of the  adverse event.&lt;br /&gt;
&lt;br /&gt;
''Please note: the specialist'' ''is unable to set causality until the  MedDRA term has been selected.''&lt;br /&gt;
&lt;br /&gt;
'''Step 3:''' On completion,  the PV specialist confirms causality has been set.&lt;br /&gt;
&lt;br /&gt;
'''Step 4:''' The report is  moved into a new activity: Extract E2B.&lt;br /&gt;
|'''Set MedDRA and Causality''' &lt;br /&gt;
&lt;br /&gt;
The purpose of  this activity is to facilitate the setting of the MedDRA terminology for the  event and to set causality per medication using either the Naranjo or WHO  causality scales.&lt;br /&gt;
&lt;br /&gt;
The PV specialist  has the following options: &lt;br /&gt;
&lt;br /&gt;
* Set Terminology&lt;br /&gt;
* WHO Causality&lt;br /&gt;
* Naranjo Causality&lt;br /&gt;
* Confirm Causality Set&lt;br /&gt;
|-&lt;br /&gt;
|'''Activity: Extract E2B'''&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' PV technician creates  an E2B XML file for submission.&lt;br /&gt;
&lt;br /&gt;
''Please note: a patient  summary is stored at the time of generating the E2B XML to allow for data  verification.''&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' PV technician  then confirms that the E2B XML file has been submitted to WHO.&lt;br /&gt;
&lt;br /&gt;
* A receipt code and time can be noted here&lt;br /&gt;
&lt;br /&gt;
''Please note: submission to  WHO UMC is a manual process.''&lt;br /&gt;
|'''Extract E2B'''&lt;br /&gt;
&lt;br /&gt;
The purpose of  this activity is to facilitate sharing of E2B adverse drug reactions with the  WHO Uppsala Monitoring Centre using the ICH ICSR E2B specification.&lt;br /&gt;
&lt;br /&gt;
The PV specialist  has the following options: &lt;br /&gt;
&lt;br /&gt;
* Create E2B&lt;br /&gt;
* Confirm E2B submission&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |'''PROCESS COMPLETED'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.3.3       Identifying New Reports ===&lt;br /&gt;
It is possible to identify new active or spontaneous reports using the notification panel in the main system header. A number next to the notification icon indicates you either have a new adverse event report requiring analysis or new terminology has been defined for an existing report.&lt;br /&gt;
&lt;br /&gt;
The number of new reports registered within a pre-defined period of time is displayed as a value in the notification list of menu items.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|This alert will vary in count depending on the '''ReportInstanceNewAlertCount'''  configuration. Please speak to your system administrator to confirm what this  value is set to in days.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.3.4       Search for a Report ===&lt;br /&gt;
In the '''Reports''' function for Spontaneous and Active Reporting, you can '''Search''' for new reports that have been created. The '''Reports''' function can be accessed either through the Spontaneous or Active menu.&lt;br /&gt;
&lt;br /&gt;
There are three ways to search for a report. You can search by:&lt;br /&gt;
&lt;br /&gt;
●     Activity (what stage of analysis the report is currently in)&lt;br /&gt;
&lt;br /&gt;
●     Report date range&lt;br /&gt;
&lt;br /&gt;
●     By a search term&lt;br /&gt;
&lt;br /&gt;
==== 1.3.4.1       Search by Active Work ====&lt;br /&gt;
Searching by activity allows you to search for all incomplete reports by the current stage a report may be in or by listing all new reports that have been identified as per the '''ReportInstanceNewAlertCount''' configuration'''.'''&lt;br /&gt;
&lt;br /&gt;
·        Select the '''New Reports''' button to view a list of new reports within the system &lt;br /&gt;
&lt;br /&gt;
·        Or select the current activity stage if you would like to filter reports based on the stage they are currently in&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|'''Confirm Report Data Stage:''' Search  on all reports that are newly submitted and are not yet VERIFIED.&lt;br /&gt;
&lt;br /&gt;
'''Set MedDRA and Causality:''' Search  on all reports that have been VERIFIED and are in the process of being  defined through terminology.&lt;br /&gt;
&lt;br /&gt;
'''Extract E2B:''' Search  on all reports that have all terminology defined and are ready to extract  information for submission to the WHO Uppsala Monitoring Centre.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will display a list of reports according to the filter selected, please note the Unique Identifier of the report in column 2.&lt;br /&gt;
&lt;br /&gt;
==== 1.3.4.2       Search for all Reports within a Date Range ====&lt;br /&gt;
Search by date range searches for all complete and incomplete reports within a given date range.&lt;br /&gt;
&lt;br /&gt;
·        Enter the '''Search From''' and '''Search To date fields''' for the date range to search.&lt;br /&gt;
&lt;br /&gt;
·        Click the '''Search''' button. &lt;br /&gt;
&lt;br /&gt;
The system will display a list of reports according to the filter selected, please note the Unique Identifier of the report in column 2.&lt;br /&gt;
&lt;br /&gt;
==== 1.3.4.3       Search Reports by Term ====&lt;br /&gt;
The '''Search by term''' tab allows the user to search for all reports using the following criteria:&lt;br /&gt;
&lt;br /&gt;
·        Patient name&lt;br /&gt;
&lt;br /&gt;
·        MedDRA term as set by the clinician and technician&lt;br /&gt;
&lt;br /&gt;
·        Report identifier&lt;br /&gt;
&lt;br /&gt;
·        Medications&lt;br /&gt;
&lt;br /&gt;
The search function uses a partial term to search all reports on the terms noted above. For instance, searching for the term Accelerated returns all reports that have that partial term in the MedDRA term for the report.&lt;br /&gt;
&lt;br /&gt;
The columns in the report table are described below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Created&lt;br /&gt;
|The  date and time the report was registered in the analytical portal&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Identifier&lt;br /&gt;
|Unique  identifier for the report (system generated)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Patient&lt;br /&gt;
|Patient  name&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Medication Summary&lt;br /&gt;
|Overview  of all medications associated with the patient at the time of the event, including  the WHO or Naranjo causality assessment outcome once that has been set&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Adverse Event&lt;br /&gt;
|The  adverse event experienced by the patient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|MedDRA Terminology&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |The  unique and internationally recognized MedDRA term defined for the event&lt;br /&gt;
|-&lt;br /&gt;
|Status&lt;br /&gt;
|Current  status of the report&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Actions&lt;br /&gt;
|'''Confirm Report  Data Stage'''&lt;br /&gt;
&lt;br /&gt;
View  Activity History&lt;br /&gt;
&lt;br /&gt;
Confirm  or Delete Report&lt;br /&gt;
&lt;br /&gt;
View  Patient (Active Only)&lt;br /&gt;
&lt;br /&gt;
View  SAE Report or Patient Summary&lt;br /&gt;
&lt;br /&gt;
Update  Report (Spontaneous Only)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Set MedDRA and  Causality Stage'''&lt;br /&gt;
&lt;br /&gt;
View  Activity History&lt;br /&gt;
&lt;br /&gt;
Set  Terminology (MedDRA), Naranjo or WHO Causality Term&lt;br /&gt;
&lt;br /&gt;
Confirm  Causality Set&lt;br /&gt;
&lt;br /&gt;
View  Patient (Active Only)&lt;br /&gt;
&lt;br /&gt;
View  SAE Report or Patient Summary&lt;br /&gt;
&lt;br /&gt;
Update  Report (Spontaneous Only) &lt;br /&gt;
&lt;br /&gt;
'''Extract E2B  Stage'''&lt;br /&gt;
&lt;br /&gt;
View  Activity History&lt;br /&gt;
&lt;br /&gt;
Create  or Update an E2B file&lt;br /&gt;
&lt;br /&gt;
Prepare  or Confirm E2B file for submission&lt;br /&gt;
&lt;br /&gt;
Download  XML file&lt;br /&gt;
&lt;br /&gt;
View  Patient (Active Only)&lt;br /&gt;
&lt;br /&gt;
View  SAE Report or Patient Summary&lt;br /&gt;
&lt;br /&gt;
Update  Report (Spontaneous Only)&lt;br /&gt;
|&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
== 1.4        Pharmacovigilance Activities - General ==&lt;br /&gt;
&lt;br /&gt;
=== 1.4.1       Viewing Activity History for Report ===&lt;br /&gt;
Irrespective of the stage the report is currently in, you will be able to view a comprehensive history for the report detailing all actions that have occurred, who effected the action, and any additional comments.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''View activity history''' menu for the associated report you would like to view.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''View activity history''' page.&lt;br /&gt;
&lt;br /&gt;
The columns in the activity history table are described below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Activity&lt;br /&gt;
|The  primary activity stage performed by the analyst&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Execution event&lt;br /&gt;
|The  primary activity performed by the analyst. Activities are dependent on the  stage the report is in.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Execution date&lt;br /&gt;
|The  date and time the user executed the activity&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Comments&lt;br /&gt;
|Any  comments noted by the user at the point of completing the activity&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Receipt date&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Particular  to the E2B Extract Stage. Confirmation an E2B extract has been received by  UMC and this is the associated receipt date&lt;br /&gt;
|-&lt;br /&gt;
|Receipt code&lt;br /&gt;
|Particular  to the E2B Extract Stage. Confirmation an E2B extract has been received by  UMC and this is the associated receipt code that may be supplied by UMC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Action&lt;br /&gt;
|Download  summary&lt;br /&gt;
&lt;br /&gt;
Download  extract&lt;br /&gt;
&lt;br /&gt;
Download  E2B file&lt;br /&gt;
|&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== 1.4.2       Viewing a Patient Record ===&lt;br /&gt;
The '''View patient''' menu allows the user to navigate to the Patient View for the patient so that the analyst may gather additional information to the adverse event.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''View patient''' menu for the associated report you would like to view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Patient View''' page in the Clinical Portal.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|This  menu item will only be made available under the following circumstances:&lt;br /&gt;
&lt;br /&gt;
·          Active reports only&lt;br /&gt;
&lt;br /&gt;
·          If the user has the Registration Clerk,  Data Capture or Clinician role assigned to their user profile&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 1.4.3       Extracting a Patient Summary ===&lt;br /&gt;
The '''Download summary''' menu allows the user to generate an overall summary of the patient clinical record in MS Word format. This is the preferred method of granting access to the clinical record for the analyst.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Download Summary''' menu for the associated report you would like to view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system generates an extract of the patient summary:&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|If  the event is defined as serious, the system will include additional  information that explains the seriousness of the report. The heading of the extract  will be changed to '''Serious Adverse  Event.'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.4.4       Updating a Spontaneous Report ===&lt;br /&gt;
The '''Update report''' menu allows the user to navigate to the spontaneous report for the patient and allow the analyst the ability to amend the report.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Update report''' menu for the associated report you would like to amend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Spontaneous View''' pop up form for the report.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|This  menu item will only be available for spontaneous reports.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1.5        Pharmacovigilance Activities – Confirm Report Data ==&lt;br /&gt;
&lt;br /&gt;
=== 1.5.1       Deleting a Report ===&lt;br /&gt;
The '''Confirm Report Data''' stage enforces a process whereby the analyst ensures the necessary clinical data is of sufficient quality to allow terminology and causality to be completed. In the event a report is deemed to be insufficient, inaccurate, or erroneous, a report may be deleted, which will effectively remove it from analysis.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Delete report''' menu for the associated report you would like to delete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Add Activity''' page.&lt;br /&gt;
&lt;br /&gt;
Specify the reason for deleting the record and click '''Save''' to confirm the deletion or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Once  a report is deleted, it is not possible to re-include the report for  analysis. Please ensure you are correct in deleting the report before  committing the action.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.5.2       Confirming a Report ===&lt;br /&gt;
The '''Confirm Report Data''' stage enforces a process whereby the analyst ensures the necessary clinical data is of sufficient quality to allow terminology and causality to be completed. When a report is deemed to be sufficient and accurate, the report should be confirmed, which will effectively allow terminology definition to commence.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Confirm Report''' menu for the associated report you would like to confirm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Add Activity''' page.&lt;br /&gt;
&lt;br /&gt;
Specify any additional comments for confirming the record and click '''Save''' to confirm the deletion or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Confirming  a report will move the report into the next stage: '''Set MedDRA and Causality.'''&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 1.6        Pharmacovigilance Activities – Set MedDRA and Causality ==&lt;br /&gt;
&lt;br /&gt;
=== 1.6.1       Set MedDRA Terminology ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Set Terminology''' menu for the associated report you would like to set terminology for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will pop up a '''MedDRA Terminology''' form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''MedDRA Terminology''' form displays the adverse event as reported by the clinician and/or reporter.&lt;br /&gt;
&lt;br /&gt;
MedDRA terms can be searched in the following ways:&lt;br /&gt;
&lt;br /&gt;
•           Search by MedDRA Term&lt;br /&gt;
&lt;br /&gt;
•           Search by MedDRA Code&lt;br /&gt;
&lt;br /&gt;
•           Search by MedDRA List&lt;br /&gt;
&lt;br /&gt;
==== 1.6.1.1       Search by MedDRA Term ====&lt;br /&gt;
Searching by a MedDRA term allows you the ability to filter through MedDRA using a partial or fully defined term.&lt;br /&gt;
&lt;br /&gt;
In the '''Term type''' field, select the level of specificity for the search (SOC, HLTG, HLT, PT, or LLT).&lt;br /&gt;
&lt;br /&gt;
In the '''Find by term''' field, enter the term you are searching for.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|It  is possible to complete a partial search by entering as few as 3 characters  that form part of the overall term.&lt;br /&gt;
&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Click the '''Select''' icon next to the term you would like to assign or click the '''Cancel''' button to cancel the action and return to the previous page. The report will be updated with the new term accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6.1.2       Search by MedDRA Code ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Searching by a MedDRA code allows you the ability to filter through MedDRA using an associated code which can be fully defined or partial in nature.&lt;br /&gt;
&lt;br /&gt;
In the '''Find by code''' field, enter the code you are searching for.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|It  is possible to complete a partial search by entering as few as 4 numerical  characters that form part of the overall code.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Click the '''Select''' icon next to the term you would like to assign or click the '''Cancel''' button to cancel the action and return to the previous page. The report will be updated with the new term accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6.1.3       Search for MedDRA Term by List ====&lt;br /&gt;
The list search function allows the user to navigate the MedDRA dictionary using the hierarchical structure of the dictionary. Select the System Organ Class field to select a SOC.  &lt;br /&gt;
&lt;br /&gt;
Continue selecting through the hierarchy (HLGT, HLT, PT) until you have selected the Low-Level Term that matches the adverse event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click the '''Select''' icon next to the term you would like to assign or click the '''Cancel''' button to cancel the action and return to the previous page. The report will be updated with the new term accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 1.6.2       Causality Assessment using the WHO Scale ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once the MedDRA terminology for the event has been set, the report will be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the terminology will further allow the setting of causality per medication. Click on the '''WHO Causality''' menu option for the associated report you would like to set causality for.&lt;br /&gt;
&lt;br /&gt;
The system will open up the '''WHO Causality Assessment''' pop up form.&lt;br /&gt;
&lt;br /&gt;
The '''WHO Causality Assessment''' form displays the adverse event as reported by the clinician and/or reporter and the MedDRA Terminology that has been set for the event.&lt;br /&gt;
&lt;br /&gt;
The '''WHO Causality Assessment''' form also displays the list of medications that the patient was exposed to at the onset of the adverse event. &lt;br /&gt;
&lt;br /&gt;
The analyst can perform the following actions against each medication the patient was exposed to:&lt;br /&gt;
&lt;br /&gt;
·        Ignore the medication (the medication is definitely not responsible for the adverse event)&lt;br /&gt;
&lt;br /&gt;
·        Set causality for the medication&lt;br /&gt;
&lt;br /&gt;
==== 1.6.2.1       Ignoring the Medication ====&lt;br /&gt;
Ignoring the medication means that a causality assessment need not be set for that medication.&lt;br /&gt;
&lt;br /&gt;
To ignore assigning a WHO causality assessment for this medication, click the '''Ignore Medication''' icon. The system will assign '''Ignored''' as the causality term.&lt;br /&gt;
&lt;br /&gt;
==== 1.6.2.2       Set Causality ====&lt;br /&gt;
By clicking the '''Set Causality''' icon, the system will enable you to set causality for this medication.&lt;br /&gt;
&lt;br /&gt;
The system displays a series of questions for assigning the WHO causality term.&lt;br /&gt;
&lt;br /&gt;
Click the appropriate response (Yes or No) for question 1 and continue to respond to the first five questions.&lt;br /&gt;
&lt;br /&gt;
If responses to all five questions are '''Yes,''' the system will assign '''Certain''' as the causality term.&lt;br /&gt;
&lt;br /&gt;
Click the '''Set causality icon''' next to the causality assessment and the system will assign the term as Certain in the system.&lt;br /&gt;
&lt;br /&gt;
Click the '''Close''' button at any time to undo the action and return to the list reports.&lt;br /&gt;
&lt;br /&gt;
If any of the questions in the Certain category have a response of '''No''' the system will display questions for the Probable/Likely category.&lt;br /&gt;
&lt;br /&gt;
Continue this process until you have answered '''Yes''' to all questions in a specific category. This will result in the classification for that medication being set to that category.&lt;br /&gt;
&lt;br /&gt;
In the event you reach the '''Unassessable/Unclassified''' category, if one of the two questions asked in that category is answered as '''No,''' the system will trigger an alert.&lt;br /&gt;
&lt;br /&gt;
Once the term has been assigned click the '''Close''' button to continue. &lt;br /&gt;
&lt;br /&gt;
=== 1.6.3       Causality Assessment using the Naranjo Scale ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once the MedDRA terminology for the event has been set, the report will be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the terminology will further allow the setting of causality per medication. Click on the '''Naranjo Causality''' menu for the associated report you would like to set causality for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will open up the '''Naranjo Causality Assessment''' pop up form.&lt;br /&gt;
&lt;br /&gt;
The '''Naranjo Causality Assessment''' form displays the adverse event as reported by the clinician and/or reporter and the MedDRA Terminology set.&lt;br /&gt;
&lt;br /&gt;
The '''Naranjo Causality Assessment''' form also displays the list of medications that the patient was exposed to at the onset of the adverse event. &lt;br /&gt;
&lt;br /&gt;
The analyst can perform the following actions against each medication the patient was exposed to:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·        Ignore the medication (the medication is definitely not responsible for the adverse event)&lt;br /&gt;
&lt;br /&gt;
·        Set causality for the medication&lt;br /&gt;
&lt;br /&gt;
==== 1.6.3.1       Ignoring the Medication ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ignoring the medication means that a causality assessment need not be set for that medication.&lt;br /&gt;
&lt;br /&gt;
To ignore assigning a Naranjo causality assessment for this medication, click the '''Ignore Medication''' icon. The system will assign '''Ignored''' as the causality term.&lt;br /&gt;
&lt;br /&gt;
==== 1.6.3.2       Set Causality ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By clicking the '''Set Causality''' icon, the system will enable you to set causality for this medication.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system displays a series of questions for calculating the Naranjo causality score.&lt;br /&gt;
&lt;br /&gt;
Click the appropriate response (Yes or No) for question 1 and continue to respond to all remaining questions.  Once all responses have been selected, the system will automatically calculate the causality assessment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click the '''Set causality icon''' next to the causality assessment and the system will assign the term as per the calculation in the system.&lt;br /&gt;
&lt;br /&gt;
Click the '''Close''' button at any time to undo the action and return to the list reports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 1.6.4       Confirming Causality Set ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once causality for all medications has been set, the report will be updated accordingly. &lt;br /&gt;
&lt;br /&gt;
Click on the '''Confirm Causality Set''' menu for the associated report you would like to confirm causality set for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Confirm Causality Set''' form.&lt;br /&gt;
&lt;br /&gt;
Specify any comment if necessary and click '''Save''' to confirm the setting of the causality or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly. Please note the report will now be located in the Extract E2B tab.&lt;br /&gt;
&lt;br /&gt;
== 1.7        Pharmacovigilance Activities – Extract E2B ==&lt;br /&gt;
&lt;br /&gt;
=== 1.7.1       Create E2B ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''BUZZWORDS''' &lt;br /&gt;
&lt;br /&gt;
'''ICH E2B:''' An E2B dataset facilitates the Electronic Transmission of  Individual Case Safety Reports (ICSRs) and can be used to submit such reports  to WHO. The E2B dataset within PViMS is implemented using the standard  adopted by the ICH1 for electronic transmission of ICSRs according to the ICH  E2B(R3) message standard.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''Extract E2B''' stage generates an E2B extract for submission to the World Health Organization Uppsala Monitoring Centre.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;By  clicking this menu item, the system generates an E2B dataset that is populated  with clinical information from the source form. This E2B dataset can be  amended by you to reflect additional clinical information pertinent to WHO.  This menu item is only available for forms that are in the Extract E2B | NOTGENERATED  stage.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Once you have searched for a report, click on the '''Create E2B''' menu for the associated report you would like to create E2B for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the system has created the E2B dataset, the status of the report will be updated to E2BINITIATED to indicate the dataset has been created.&lt;br /&gt;
&lt;br /&gt;
The E2B dataset is constructed with the following sections (these sections are based on R2 of the E2B ICH definition):&lt;br /&gt;
&lt;br /&gt;
·        Message Header&lt;br /&gt;
&lt;br /&gt;
·        Safety Report&lt;br /&gt;
&lt;br /&gt;
·        Primary Source&lt;br /&gt;
&lt;br /&gt;
·        Sender&lt;br /&gt;
&lt;br /&gt;
·        Receiver&lt;br /&gt;
&lt;br /&gt;
·        Patient&lt;br /&gt;
&lt;br /&gt;
·        Medical History Episode&lt;br /&gt;
&lt;br /&gt;
·        Past Drug Therapy&lt;br /&gt;
&lt;br /&gt;
·        Patient Death&lt;br /&gt;
&lt;br /&gt;
·        Reaction&lt;br /&gt;
&lt;br /&gt;
·        Test&lt;br /&gt;
&lt;br /&gt;
·        Drug&lt;br /&gt;
&lt;br /&gt;
·        Summary&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''ICH E2B:''' Please see the electronic  Transmission of Individual Case Safety Reports Message Specification for detail  specifications on the above categories. This specification can be found on &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://admin.ich.org/sites/default/files/inline-files/ICH_ICSR_Specification_V2-3.pdf&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== 1.7.2       Adding Information to and Updating an E2B File ===&lt;br /&gt;
Once an E2B file is created, the '''Update E2B''' menu allows the user to add information to or updating existing information populated in an E2B file.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Update E2B''' menu for the associated file you would like to amend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will pop up a '''E2B ICH Report''' form for the file.&lt;br /&gt;
&lt;br /&gt;
Once you completed making amendments, click on the '''Save''' button to save the changes or the '''Cancel''' button to cancel the action and return to the previous page.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
=== 1.7.3       Preparing a Report for E2B Submission ===&lt;br /&gt;
The '''Extract E2B''' stage facilitates the process of generating an E2B extract for submission to the World Health Organization Uppsala Monitoring Centre.&lt;br /&gt;
&lt;br /&gt;
Once you have created an E2B file and searched for the report, click on the '''Prepare Report for E2B Submission''' menu for the associated report you would like to prepare.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Prepare report for E2B submission''' pop up form.&lt;br /&gt;
&lt;br /&gt;
Specify any additional comments for preparing the record and click '''Save''' to confirm the preparation or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|It  is during this stage that PViMS prepares the XML file for submission. It also  prepares an associated patient summary and patient extract that correspond to  the clinical data at the point of generating the submission.&lt;br /&gt;
&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== 1.7.4       Viewing the E2B XML File ===&lt;br /&gt;
Once you have prepared the E2B file for submission and searched for the report, click on the '''View Activity History''' menu for the associated report you would like to view the XML file for.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Activities''' page where you will be able to view a comprehensive history of activities by the analyst against this adverse event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Locate the '''E2BGENERATED''' execution event for the report, click the menu for that event, and select the '''Download E2B File''' menu.&lt;br /&gt;
&lt;br /&gt;
The system will automatically generate the XML file for the E2B submission to WHO. Save the file on your local computer for referral when sending to WHO.&lt;br /&gt;
&lt;br /&gt;
The extract below is the XML generated for the Message Header section of the XML file.  &lt;br /&gt;
&lt;br /&gt;
=== 1.7.5       Viewing the Clinical Data Associated to the E2B XML File ===&lt;br /&gt;
Once you have prepared the E2B file for submission and searched for the report, click on the '''View Activity History''' menu for the associated report you would like to view the XML file for.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Activities''' page where you will be able to view a comprehensive history of activities by the analyst against this adverse event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Locate the '''E2BGENERATED''' execution event for the report, click the action menu, and select the '''Download summary or Download extract''' menu.&lt;br /&gt;
&lt;br /&gt;
If you select the '''Download summary''' menu, the system will generate a MS Word extract of the associated clinical data. See Extracting a Patient Summary.&lt;br /&gt;
&lt;br /&gt;
If you select the '''Download extract''' menu, the system will generate an MS Excel extract of the associated clinical data.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|In  both the Patient Extract and Summary above, these files are stored along with  the XML file as a reference to the clinical data associated with the XML file  at the point the XML file was generated.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.7.6       Confirming a Report for E2B Submission ===&lt;br /&gt;
Once you have prepared the E2B file for submission and searched for the report, click on the '''Confirm E2B Submission''' menu for the associated report you would like to submit.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Confirm E2B Submission''' pop up form.&lt;br /&gt;
&lt;br /&gt;
Specify any additional comments for confirming the submission and click '''Save''' to confirm the submission or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|The  receipt date and code can be used to note correspondence with WHO on the  receipt of the E2B XML submission file.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
The system will update the status of the report accordingly. Please note that the report is removed from the Extract E2B tab as work for this report is now classified as finished. Use the S'''earch by date''' or '''Search by term''' tabs to locate this report again.&lt;br /&gt;
&lt;br /&gt;
== 1.8        Analyser ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|This section is used to generate the relative risk  for a specified adverse drug reaction based on an exposed and non-exposed  population set over a defined period of time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The analyser user can access the following  functionality within the analytical portal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·          Define  population set (cohort or condition group)&lt;br /&gt;
&lt;br /&gt;
·          Define  reporting period&lt;br /&gt;
&lt;br /&gt;
·          Specify  additional risk factors&lt;br /&gt;
&lt;br /&gt;
·          View risk  ratios per exposed drug&lt;br /&gt;
&lt;br /&gt;
·          Download  dataset for further analysis&lt;br /&gt;
|}&lt;br /&gt;
'''2        '''&lt;br /&gt;
&lt;br /&gt;
2.1       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.2       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.3       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.4       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.5       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.6       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.7       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.8       ''' '''&lt;br /&gt;
&lt;br /&gt;
=== 2.8.1       Methodology ===&lt;br /&gt;
The following formulas, calculations and definitions are used in the calculation of the relative risk for a specific medication and adverse reaction. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.8.1.1       Incidence Rate ====&lt;br /&gt;
The incidence rate is the number of new cases per population in a given time period&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|IR = (ADR / Population) * 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Where'''&lt;br /&gt;
&lt;br /&gt;
IR = Incidence  Rate&lt;br /&gt;
&lt;br /&gt;
ADR = Number of  adverse drug reactions *&lt;br /&gt;
&lt;br /&gt;
Population =  Total patient years in reporting period **&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Where  causality is set to possible, probably/likely or Certain for WHO assessments  and where causality is set to possible, probable or definite for Naranjo  assessments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt; Population  is represented in patient years. For example, if the reporting period is 30  days, and 10 patients were on treatment for all 30 days, the total patient  years is 300 /365.25 which is 0.82.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
Cases = 11&lt;br /&gt;
&lt;br /&gt;
Non-Cases = 170&lt;br /&gt;
&lt;br /&gt;
Population =  181 (11 + 170)&lt;br /&gt;
&lt;br /&gt;
Incidence Rate  = 11/181 * 1000 = '''60.77'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 1.8.1.2       Relative Risk ====&lt;br /&gt;
Relative risk is defined as the incidence in the exposed over incidence in the non-exposed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RR= IR1 / IR2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Where'''&lt;br /&gt;
&lt;br /&gt;
RR = Relative Risk&lt;br /&gt;
&lt;br /&gt;
IR1 = Incidence Rate for exposed population. The  exposed population is defined as the patient population that have been  exposed to a medication in the reporting period.&lt;br /&gt;
&lt;br /&gt;
IR2 = Incidence Rate for non-exposed population.  The exposed population is defined as the patient population that have NOT  been exposed to a medication in the reporting period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
Incidence Rate Exposed = 60.77&lt;br /&gt;
&lt;br /&gt;
Incidence Rate Non-Exposed = 45.12&lt;br /&gt;
&lt;br /&gt;
RR = '''1.35'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 1.8.1.3       Confidence Interval ====&lt;br /&gt;
A confidence interval is a range of values so defined that there is a specified probability that the value of a parameter lies within it. Most commonly, the 95% confidence interval is used.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
'''Where'''&lt;br /&gt;
&lt;br /&gt;
''z''&amp;lt;sub&amp;gt;α&amp;lt;/sub&amp;gt; is the  standard score for the chosen level of significance and SE the standard  error.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.8.2       Generating Unadjusted Relative Risk Ratios ===&lt;br /&gt;
To implement the methodology for generating an '''Unadjusted Relative Risk Ratio,''' the following parameters will need to be specified:&lt;br /&gt;
&lt;br /&gt;
·        The population target (condition group or Cohort)&lt;br /&gt;
&lt;br /&gt;
·        The date range for the analysis&lt;br /&gt;
&lt;br /&gt;
The '''Analyser''' function can be accessed through the main menu.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.1       Specifying the Population Group ====&lt;br /&gt;
Ensure the '''Analysis Criteria''' tab is selected to allow the selection of the patient population.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By selecting a '''Condition Group''' or '''Cohort''', you are effectively able to target a specific set of patients for analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Condition Group,''' click the Primary Condition Group Risk Factor field and select the primary condition you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Condition Group will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Cohort,''' click the Cohort field and select the primary cohort you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Cohort will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.2       Specifying the Date Range for the Analysis ====&lt;br /&gt;
By selecting a '''Date Range''', the system will determine which patients should be included into the analysis from the Patient Population specified in the previous step. Patients that have been actively exposed to medication within that range will be included.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.3       Running the Analysis ====&lt;br /&gt;
Once the '''Patient Population''' and '''Date Range''' parameters have been selected, click on the '''Analyse''' button to execute the analysis.&lt;br /&gt;
&lt;br /&gt;
The system will conduct an initial analysis that will identify what Adverse Drug Reactions have been identified over the reporting period. All results are included in the '''Analysis Results''' tab. Please note that only adverse drug reactions where a MedDRA term has been selected by the PV technician will be selected.&lt;br /&gt;
&lt;br /&gt;
Select the '''Adverse Drug Reaction''' that you would like to detect signals for by clicking on the tab for that reaction. The selected tab will turn a dark blue to signify that it has been selected.&lt;br /&gt;
&lt;br /&gt;
Please note that selecting the Adverse Drug Reaction will enable the Dashboard and Patients tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You are able to now view a 2 by 2 table illustrating relative risk and 95% Confidence Interval for the selected reaction.&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for exposed group&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for non-exposed group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·        Relative Risk for the associated medication&lt;br /&gt;
&lt;br /&gt;
·        95% Confidence Interval for the associated medication &lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.4       Viewing the Contributing Patient List ====&lt;br /&gt;
Once analysis has been executed, it is possible to view the list of patients that have contributed to the analysis population set through the '''Patients''' tab.&lt;br /&gt;
&lt;br /&gt;
The columns in the patient list table are described below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Patient name&lt;br /&gt;
|The name of the patient  contributing to the patient population&lt;br /&gt;
|-&lt;br /&gt;
|Medication&lt;br /&gt;
|The drug the patient  was exposed to during the period of analysis&lt;br /&gt;
|-&lt;br /&gt;
|Days  contributed&lt;br /&gt;
|The number of days the  patient contributed to the patient population&lt;br /&gt;
|-&lt;br /&gt;
|Reaction&lt;br /&gt;
|Did the patient suffer  a reaction during the period of analysis&lt;br /&gt;
|-&lt;br /&gt;
|Risk Factor&lt;br /&gt;
|Which risk factor does  the patient match&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.5       Resetting Criteria ====&lt;br /&gt;
If at any point you would like to alter the patient population or date range, click the '''Reset criteria''' tab alongside the list of Adverse Drug Reactions to reset analysis. Selecting this tab will remove existing analysis and reopen the Analysis Criteria tab for modification.&lt;br /&gt;
&lt;br /&gt;
=== 1.8.3       Generating Adjusted Relative Risk Ratios ===&lt;br /&gt;
To implement the methodology for generating an '''Adjusted Relative Risk Ratio,''' the following parameters will need to be specified:&lt;br /&gt;
&lt;br /&gt;
·        The population target (condition group or Cohort)&lt;br /&gt;
&lt;br /&gt;
·        The date range for the analysis&lt;br /&gt;
&lt;br /&gt;
·        The risk factors to be applied&lt;br /&gt;
&lt;br /&gt;
The '''Analyser''' function can be accessed through the main menu.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.3.1       Specifying the Population Group ====&lt;br /&gt;
Ensure the '''Analysis Criteria''' tab is selected to allow the selection of the patient population.&lt;br /&gt;
&lt;br /&gt;
By selecting a '''Condition Group''' or '''Cohort''', you are effectively able to target a specific set of patients for analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Condition Group,''' click the Primary Condition Group Risk Factor field and select the primary condition you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Condition Group will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Cohort,''' click the Cohort field and select the primary cohort you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Cohort will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.3.2       Specifying the Date Range for the Analysis ====&lt;br /&gt;
By selecting a '''Date Range''', the system will determine which patients should be included into the analysis from the Patient Population specified in the previous step. Patients that have been actively exposed to medication within that range will be included. &lt;br /&gt;
==== 1.8.3.3       Specifying Risk Factors for the Analysis ====&lt;br /&gt;
&lt;br /&gt;
To specify a '''Risk Factor,''' click the Risk factor field and select the risk factor you would like to include into the analysis. Once you have selected the risk factor, select the appropriate option associated to that risk factor and click the '''add''' icon to add the risk factor to the selected list.&lt;br /&gt;
&lt;br /&gt;
You are able to add as many risk factors as you would like to include into the analysis by repeating the above process.&lt;br /&gt;
&lt;br /&gt;
By including '''Risk Factors''' into the analysis, the system will determine which patients match the criteria stipulated by the set of risk factors and the corresponding '''Relative Risk Ratio''' will be adjusted based on the new population set.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.3.4       Running the Analysis ====&lt;br /&gt;
Once the '''Patient Population, Date Range, and Risk Factor''' parameters have been selected, click on the '''Analyse''' button to execute the analysis.&lt;br /&gt;
&lt;br /&gt;
The system will conduct an initial analysis that will identify what Adverse Drug Reactions have been identified over the reporting period. All results are included in the '''Analysis Results''' tab. Please note that only adverse drug reactions where a MedDRA term has been selected by the PV technician will be selected.&lt;br /&gt;
&lt;br /&gt;
Select the '''Adverse Drug Reaction''' that you would like to detect signals for by clicking on the tab for that reaction. The selected tab will turn a dark blue to signify that it has been selected.&lt;br /&gt;
&lt;br /&gt;
Please note that selecting the Adverse Drug Reaction will enable the Dashboard and Patients tab.&lt;br /&gt;
&lt;br /&gt;
You are able to now view a 2 by 2 table illustrating relative risk and 95% Confidence Interval for the selected reaction.&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for exposed group&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for non-exposed group&lt;br /&gt;
&lt;br /&gt;
·        Relative Risk for the associated medication&lt;br /&gt;
&lt;br /&gt;
·        95% Confidence Interval for the associated medication  &lt;br /&gt;
=== 1.8.4       Downloading a Dataset for Further Analysis ===&lt;br /&gt;
Select the '''Download Data''' tab and then click the '''Download Dataset''' button to able to download a comprehensive dataset of patient clinical data in XLSX Excel format for importation into a third-party statistical tool.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|If  you are unable to locate this function, please liaise with your system  administrator as the ability to download a dataset for external consumption will  need to be assigned to your user profile.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
The Excel file password is: rcAHtHx&amp;amp;pN6cE3kL&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_User_Manual_Chapter_5&amp;diff=154</id>
		<title>OpenRIMS-PVM - User Manual Chapter 5</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_User_Manual_Chapter_5&amp;diff=154"/>
		<updated>2023-09-12T15:41:37Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* 1.8.4       Downloading a Dataset for Further Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Analytical Portal =&lt;br /&gt;
At the '''Home Page''' of the Analytical Portal''',''' you will be presented with the following options:&lt;br /&gt;
&lt;br /&gt;
●     Spontaneous and Active Reports&lt;br /&gt;
&lt;br /&gt;
●     Spontaneous and Active Analyzer &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|The  analytical portal is the centralized hub for causative drug assessment using  traditional recognized rating scales, standardized terminology, and risk  detection with exposed versus non-exposed risk ratios.&lt;br /&gt;
&lt;br /&gt;
'''Note''': the following roles have access to the analytical  portal: &lt;br /&gt;
&lt;br /&gt;
·          '''Administrator.''' The  administrator has FULL permissions to the analytical portal.&lt;br /&gt;
&lt;br /&gt;
·          '''Analyst.''' An  analytics user is able to assign terminology, set causality and run analysis  on collected data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Click on the    user profile menu option which appears when clicking on the profile icon to    view roles and facilities you currently have access to.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Spontaneous Reporting ==&lt;br /&gt;
Spontaneous reports are termed spontaneous as they take place during the clinician’s normal diagnostic appraisal of a patient, when the clinician is drawing the conclusion that the drug may be implicated in the causality of the event.&lt;br /&gt;
&lt;br /&gt;
Spontaneous reporting system relies on vigilant physicians, other healthcare professionals, and patients who not only generate a suspicion of an ADR, but also report it.&lt;br /&gt;
&lt;br /&gt;
It is an important source of regulatory actions such as taking a drug off the market or a label change due to safety problems. Spontaneous reporting is the core data-generating system of international pharmacovigilance, relying on healthcare professionals (and, in some countries, consumers) to identify and report any adverse events to their national pharmacovigilance center.&lt;br /&gt;
&lt;br /&gt;
Spontaneous reports are, by definition, submitted voluntarily.&lt;br /&gt;
&lt;br /&gt;
PViMS facilitates a public facing interface that allows clinicians or the public itself to spontaneously report on adverse event related data. See chapter 8 for more information.&lt;br /&gt;
&lt;br /&gt;
== Active Reporting ==&lt;br /&gt;
Active surveillance for monitoring the safety and effectiveness of medical products is increasingly recognized as a complement to spontaneous reporting commonly used by pharmacovigilance systems. Integrated mechanisms and processes for monitoring the safety of medicines are essential to a well-functioning pharmaceutical sector. A positive benefit-to-risk balance should precede access to market; however, most regulatory decisions take place early in the product lifecycle and are based on limited data from clinical trials that may be of relatively short duration with limited numbers and types of subjects.&lt;br /&gt;
&lt;br /&gt;
It is critical, therefore, that medicines continue to be monitored for safety and effectiveness once they enter the market under real-life conditions. For some medicines, issues will only emerge under real-world conditions as a result of prolonged use, use in specific subpopulations or in patients with multiple comorbidities, or use in combination with other medicines. In some cases, rare adverse effects only emerge after a product is used for many years, by large numbers of patients, or both.&lt;br /&gt;
&lt;br /&gt;
Active surveillance is particularly important to support the introduction of new essential medicines in LMICs whose regulatory systems are being developed and are in need of support. In resource-limited settings, active surveillance can help determine the real-life frequency, risk factors, and impact of clinically significant adverse medicine events on treatment outcomes. &lt;br /&gt;
&lt;br /&gt;
== Pharmacovigilance Activities ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|This section describes the common  processes adopted by the pharmacovigilance unit in responding to both  spontaneous and active reports submitted through PViMS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''PLEASE  NOTE:''' In relation to spontaneous reports,  the patient identified in the report does '''NOT''' form part of the active reporting patient dataset. Therefore,  spontaneous reports do not form part of any analysis conducted through the analyzer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following activities are facilitated  in the Analytical portal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·          Verify quality  of report data&lt;br /&gt;
&lt;br /&gt;
·          Set terminology  for adverse drug reaction (MedDRA)&lt;br /&gt;
&lt;br /&gt;
·          Set causality  per drug (Naranjo or WHO)&lt;br /&gt;
&lt;br /&gt;
·          Create and  update E2B files (Export to XML)&lt;br /&gt;
&lt;br /&gt;
·          Generate a  patient summary&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Terminology ====&lt;br /&gt;
'''Causality Assessment Scale or Terms.''' The assessment scales or terms were developed to help standardize assessment of causality for all adverse drug reactions. The result is determined by an algorithm designed by Naranjo or WHO for determining the likelihood of whether an adverse drug event is actually due to the drug rather than the result of other factors. Probability is assigned via a score termed definite, probable, possible or doubtful (Naranjo) or certain, probable/likely, possible, unlikely, conditional, unassessable or unclassified (WHO). Values obtained from this algorithm are sometimes used in peer reviews to verify the validity of author's conclusions regarding adverse drug reactions.&lt;br /&gt;
&lt;br /&gt;
'''MedDRA Terminology'''. MedDRA or Medical Dictionary for Regulatory Activities is a clinically validated international medical terminology dictionary by regulatory authorities in the pharmaceutical industry during the regulatory process, from pre-marketing to post-marketing activities, and for data entry, retrieval, evaluation, and presentation. In addition, it is the adverse event classification dictionary endorsed by the International Conference on Harmonization of Technical Requirements for Registration of Pharmaceuticals for Human Use (ICH). &lt;br /&gt;
&lt;br /&gt;
'''E2B'''. The international standard for transmitting medicine adverse event reports specified by the ICH.&lt;br /&gt;
&lt;br /&gt;
==== 1.3.2       Process Flow ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Activity: Start of Process'''&lt;br /&gt;
&lt;br /&gt;
Clinician adds  a new adverse event to the patient record.&lt;br /&gt;
&lt;br /&gt;
Reporter adds a  new spontaneous report.&lt;br /&gt;
&lt;br /&gt;
System generates a new report for the PV  unit to action:&lt;br /&gt;
&lt;br /&gt;
* Report has a unique identifier&lt;br /&gt;
* Report has a default activity of '''Confirm Report Data'''&lt;br /&gt;
* Report has a sub status of '''UNCONFIRMED'''&lt;br /&gt;
|'''Confirm Report Data'''&lt;br /&gt;
&lt;br /&gt;
The purpose of  this activity is to facilitate the checking, vetting, and updating of the  clinical data collected for the adverse event logged. The PV unit will be  unable to perform any causality or terminology configurations until the data  is confirmed as accurate and comprehensive.&lt;br /&gt;
&lt;br /&gt;
The PV specialist  has the following options: &lt;br /&gt;
&lt;br /&gt;
* Delete Report&lt;br /&gt;
* Confirm Report&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |'''Activity: Confirm Report Data'''&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' PV specialist and  clinician/reporter update clinical data until there is sufficient information  to perform causality and terminology configurations.&lt;br /&gt;
&lt;br /&gt;
For active reporting the patient record is modified  through the clinical portal.&lt;br /&gt;
&lt;br /&gt;
For spontaneous reporting the report is modified  directly in the analytical portal.&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' Once data has  been confirmed, the PV specialist will confirm the report is ready for assessment  by selecting the Confirm report option.&lt;br /&gt;
&lt;br /&gt;
'''Step 3:''' The report is moved into a  new activity: Set MedDRA and Causality.&lt;br /&gt;
|-&lt;br /&gt;
|'''Activity: Set MedDRA and  Causality'''&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' PV specialist sets  the terminology for the adverse event. This will be the terminology used for analysis  purposes.&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' PV specialist then  sets the causality per medication that was in use at the onset date of the  adverse event.&lt;br /&gt;
&lt;br /&gt;
''Please note: the specialist'' ''is unable to set causality until the  MedDRA term has been selected.''&lt;br /&gt;
&lt;br /&gt;
'''Step 3:''' On completion,  the PV specialist confirms causality has been set.&lt;br /&gt;
&lt;br /&gt;
'''Step 4:''' The report is  moved into a new activity: Extract E2B.&lt;br /&gt;
|'''Set MedDRA and Causality''' &lt;br /&gt;
&lt;br /&gt;
The purpose of  this activity is to facilitate the setting of the MedDRA terminology for the  event and to set causality per medication using either the Naranjo or WHO  causality scales.&lt;br /&gt;
&lt;br /&gt;
The PV specialist  has the following options: &lt;br /&gt;
&lt;br /&gt;
* Set Terminology&lt;br /&gt;
* WHO Causality&lt;br /&gt;
* Naranjo Causality&lt;br /&gt;
* Confirm Causality Set&lt;br /&gt;
|-&lt;br /&gt;
|'''Activity: Extract E2B'''&lt;br /&gt;
&lt;br /&gt;
'''Step 1:''' PV technician creates  an E2B XML file for submission.&lt;br /&gt;
&lt;br /&gt;
''Please note: a patient  summary is stored at the time of generating the E2B XML to allow for data  verification.''&lt;br /&gt;
&lt;br /&gt;
'''Step 2:''' PV technician  then confirms that the E2B XML file has been submitted to WHO.&lt;br /&gt;
&lt;br /&gt;
* A receipt code and time can be noted here&lt;br /&gt;
&lt;br /&gt;
''Please note: submission to  WHO UMC is a manual process.''&lt;br /&gt;
|'''Extract E2B'''&lt;br /&gt;
&lt;br /&gt;
The purpose of  this activity is to facilitate sharing of E2B adverse drug reactions with the  WHO Uppsala Monitoring Centre using the ICH ICSR E2B specification.&lt;br /&gt;
&lt;br /&gt;
The PV specialist  has the following options: &lt;br /&gt;
&lt;br /&gt;
* Create E2B&lt;br /&gt;
* Confirm E2B submission&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |'''PROCESS COMPLETED'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.3.3       Identifying New Reports ===&lt;br /&gt;
It is possible to identify new active or spontaneous reports using the notification panel in the main system header. A number next to the notification icon indicates you either have a new adverse event report requiring analysis or new terminology has been defined for an existing report.&lt;br /&gt;
&lt;br /&gt;
The number of new reports registered within a pre-defined period of time is displayed as a value in the notification list of menu items.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|This alert will vary in count depending on the '''ReportInstanceNewAlertCount'''  configuration. Please speak to your system administrator to confirm what this  value is set to in days.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.3.4       Search for a Report ===&lt;br /&gt;
In the '''Reports''' function for Spontaneous and Active Reporting, you can '''Search''' for new reports that have been created. The '''Reports''' function can be accessed either through the Spontaneous or Active menu.&lt;br /&gt;
&lt;br /&gt;
There are three ways to search for a report. You can search by:&lt;br /&gt;
&lt;br /&gt;
●     Activity (what stage of analysis the report is currently in)&lt;br /&gt;
&lt;br /&gt;
●     Report date range&lt;br /&gt;
&lt;br /&gt;
●     By a search term&lt;br /&gt;
&lt;br /&gt;
==== 1.3.4.1       Search by Active Work ====&lt;br /&gt;
Searching by activity allows you to search for all incomplete reports by the current stage a report may be in or by listing all new reports that have been identified as per the '''ReportInstanceNewAlertCount''' configuration'''.'''&lt;br /&gt;
&lt;br /&gt;
·        Select the '''New Reports''' button to view a list of new reports within the system &lt;br /&gt;
&lt;br /&gt;
·        Or select the current activity stage if you would like to filter reports based on the stage they are currently in&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|'''Confirm Report Data Stage:''' Search  on all reports that are newly submitted and are not yet VERIFIED.&lt;br /&gt;
&lt;br /&gt;
'''Set MedDRA and Causality:''' Search  on all reports that have been VERIFIED and are in the process of being  defined through terminology.&lt;br /&gt;
&lt;br /&gt;
'''Extract E2B:''' Search  on all reports that have all terminology defined and are ready to extract  information for submission to the WHO Uppsala Monitoring Centre.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will display a list of reports according to the filter selected, please note the Unique Identifier of the report in column 2.&lt;br /&gt;
&lt;br /&gt;
==== 1.3.4.2       Search for all Reports within a Date Range ====&lt;br /&gt;
Search by date range searches for all complete and incomplete reports within a given date range.&lt;br /&gt;
&lt;br /&gt;
·        Enter the '''Search From''' and '''Search To date fields''' for the date range to search.&lt;br /&gt;
&lt;br /&gt;
·        Click the '''Search''' button. &lt;br /&gt;
&lt;br /&gt;
The system will display a list of reports according to the filter selected, please note the Unique Identifier of the report in column 2.&lt;br /&gt;
&lt;br /&gt;
==== 1.3.4.3       Search Reports by Term ====&lt;br /&gt;
The '''Search by term''' tab allows the user to search for all reports using the following criteria:&lt;br /&gt;
&lt;br /&gt;
·        Patient name&lt;br /&gt;
&lt;br /&gt;
·        MedDRA term as set by the clinician and technician&lt;br /&gt;
&lt;br /&gt;
·        Report identifier&lt;br /&gt;
&lt;br /&gt;
·        Medications&lt;br /&gt;
&lt;br /&gt;
The search function uses a partial term to search all reports on the terms noted above. For instance, searching for the term Accelerated returns all reports that have that partial term in the MedDRA term for the report.&lt;br /&gt;
&lt;br /&gt;
The columns in the report table are described below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Created&lt;br /&gt;
|The  date and time the report was registered in the analytical portal&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Identifier&lt;br /&gt;
|Unique  identifier for the report (system generated)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Patient&lt;br /&gt;
|Patient  name&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Medication Summary&lt;br /&gt;
|Overview  of all medications associated with the patient at the time of the event, including  the WHO or Naranjo causality assessment outcome once that has been set&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Adverse Event&lt;br /&gt;
|The  adverse event experienced by the patient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|MedDRA Terminology&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |The  unique and internationally recognized MedDRA term defined for the event&lt;br /&gt;
|-&lt;br /&gt;
|Status&lt;br /&gt;
|Current  status of the report&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Actions&lt;br /&gt;
|'''Confirm Report  Data Stage'''&lt;br /&gt;
&lt;br /&gt;
View  Activity History&lt;br /&gt;
&lt;br /&gt;
Confirm  or Delete Report&lt;br /&gt;
&lt;br /&gt;
View  Patient (Active Only)&lt;br /&gt;
&lt;br /&gt;
View  SAE Report or Patient Summary&lt;br /&gt;
&lt;br /&gt;
Update  Report (Spontaneous Only)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Set MedDRA and  Causality Stage'''&lt;br /&gt;
&lt;br /&gt;
View  Activity History&lt;br /&gt;
&lt;br /&gt;
Set  Terminology (MedDRA), Naranjo or WHO Causality Term&lt;br /&gt;
&lt;br /&gt;
Confirm  Causality Set&lt;br /&gt;
&lt;br /&gt;
View  Patient (Active Only)&lt;br /&gt;
&lt;br /&gt;
View  SAE Report or Patient Summary&lt;br /&gt;
&lt;br /&gt;
Update  Report (Spontaneous Only) &lt;br /&gt;
&lt;br /&gt;
'''Extract E2B  Stage'''&lt;br /&gt;
&lt;br /&gt;
View  Activity History&lt;br /&gt;
&lt;br /&gt;
Create  or Update an E2B file&lt;br /&gt;
&lt;br /&gt;
Prepare  or Confirm E2B file for submission&lt;br /&gt;
&lt;br /&gt;
Download  XML file&lt;br /&gt;
&lt;br /&gt;
View  Patient (Active Only)&lt;br /&gt;
&lt;br /&gt;
View  SAE Report or Patient Summary&lt;br /&gt;
&lt;br /&gt;
Update  Report (Spontaneous Only)&lt;br /&gt;
|&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
== 1.4        Pharmacovigilance Activities - General ==&lt;br /&gt;
&lt;br /&gt;
=== 1.4.1       Viewing Activity History for Report ===&lt;br /&gt;
Irrespective of the stage the report is currently in, you will be able to view a comprehensive history for the report detailing all actions that have occurred, who effected the action, and any additional comments.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''View activity history''' menu for the associated report you would like to view.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''View activity history''' page.&lt;br /&gt;
&lt;br /&gt;
The columns in the activity history table are described below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Activity&lt;br /&gt;
|The  primary activity stage performed by the analyst&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Execution event&lt;br /&gt;
|The  primary activity performed by the analyst. Activities are dependent on the  stage the report is in.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Execution date&lt;br /&gt;
|The  date and time the user executed the activity&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Comments&lt;br /&gt;
|Any  comments noted by the user at the point of completing the activity&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Receipt date&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Particular  to the E2B Extract Stage. Confirmation an E2B extract has been received by  UMC and this is the associated receipt date&lt;br /&gt;
|-&lt;br /&gt;
|Receipt code&lt;br /&gt;
|Particular  to the E2B Extract Stage. Confirmation an E2B extract has been received by  UMC and this is the associated receipt code that may be supplied by UMC&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Action&lt;br /&gt;
|Download  summary&lt;br /&gt;
&lt;br /&gt;
Download  extract&lt;br /&gt;
&lt;br /&gt;
Download  E2B file&lt;br /&gt;
|&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== 1.4.2       Viewing a Patient Record ===&lt;br /&gt;
The '''View patient''' menu allows the user to navigate to the Patient View for the patient so that the analyst may gather additional information to the adverse event.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''View patient''' menu for the associated report you would like to view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Patient View''' page in the Clinical Portal.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|This  menu item will only be made available under the following circumstances:&lt;br /&gt;
&lt;br /&gt;
·          Active reports only&lt;br /&gt;
&lt;br /&gt;
·          If the user has the Registration Clerk,  Data Capture or Clinician role assigned to their user profile&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 1.4.3       Extracting a Patient Summary ===&lt;br /&gt;
The '''Download summary''' menu allows the user to generate an overall summary of the patient clinical record in MS Word format. This is the preferred method of granting access to the clinical record for the analyst.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Download Summary''' menu for the associated report you would like to view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system generates an extract of the patient summary:&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|If  the event is defined as serious, the system will include additional  information that explains the seriousness of the report. The heading of the extract  will be changed to '''Serious Adverse  Event.'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.4.4       Updating a Spontaneous Report ===&lt;br /&gt;
The '''Update report''' menu allows the user to navigate to the spontaneous report for the patient and allow the analyst the ability to amend the report.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Update report''' menu for the associated report you would like to amend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Spontaneous View''' pop up form for the report.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|This  menu item will only be available for spontaneous reports.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1.5        Pharmacovigilance Activities – Confirm Report Data ==&lt;br /&gt;
&lt;br /&gt;
=== 1.5.1       Deleting a Report ===&lt;br /&gt;
The '''Confirm Report Data''' stage enforces a process whereby the analyst ensures the necessary clinical data is of sufficient quality to allow terminology and causality to be completed. In the event a report is deemed to be insufficient, inaccurate, or erroneous, a report may be deleted, which will effectively remove it from analysis.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Delete report''' menu for the associated report you would like to delete.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Add Activity''' page.&lt;br /&gt;
&lt;br /&gt;
Specify the reason for deleting the record and click '''Save''' to confirm the deletion or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Once  a report is deleted, it is not possible to re-include the report for  analysis. Please ensure you are correct in deleting the report before  committing the action.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.5.2       Confirming a Report ===&lt;br /&gt;
The '''Confirm Report Data''' stage enforces a process whereby the analyst ensures the necessary clinical data is of sufficient quality to allow terminology and causality to be completed. When a report is deemed to be sufficient and accurate, the report should be confirmed, which will effectively allow terminology definition to commence.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Confirm Report''' menu for the associated report you would like to confirm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Add Activity''' page.&lt;br /&gt;
&lt;br /&gt;
Specify any additional comments for confirming the record and click '''Save''' to confirm the deletion or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|Confirming  a report will move the report into the next stage: '''Set MedDRA and Causality.'''&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 1.6        Pharmacovigilance Activities – Set MedDRA and Causality ==&lt;br /&gt;
&lt;br /&gt;
=== 1.6.1       Set MedDRA Terminology ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Set Terminology''' menu for the associated report you would like to set terminology for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will pop up a '''MedDRA Terminology''' form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''MedDRA Terminology''' form displays the adverse event as reported by the clinician and/or reporter.&lt;br /&gt;
&lt;br /&gt;
MedDRA terms can be searched in the following ways:&lt;br /&gt;
&lt;br /&gt;
•           Search by MedDRA Term&lt;br /&gt;
&lt;br /&gt;
•           Search by MedDRA Code&lt;br /&gt;
&lt;br /&gt;
•           Search by MedDRA List&lt;br /&gt;
&lt;br /&gt;
==== 1.6.1.1       Search by MedDRA Term ====&lt;br /&gt;
Searching by a MedDRA term allows you the ability to filter through MedDRA using a partial or fully defined term.&lt;br /&gt;
&lt;br /&gt;
In the '''Term type''' field, select the level of specificity for the search (SOC, HLTG, HLT, PT, or LLT).&lt;br /&gt;
&lt;br /&gt;
In the '''Find by term''' field, enter the term you are searching for.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|It  is possible to complete a partial search by entering as few as 3 characters  that form part of the overall term.&lt;br /&gt;
&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Click the '''Select''' icon next to the term you would like to assign or click the '''Cancel''' button to cancel the action and return to the previous page. The report will be updated with the new term accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6.1.2       Search by MedDRA Code ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Searching by a MedDRA code allows you the ability to filter through MedDRA using an associated code which can be fully defined or partial in nature.&lt;br /&gt;
&lt;br /&gt;
In the '''Find by code''' field, enter the code you are searching for.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|It  is possible to complete a partial search by entering as few as 4 numerical  characters that form part of the overall code.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Click the '''Select''' icon next to the term you would like to assign or click the '''Cancel''' button to cancel the action and return to the previous page. The report will be updated with the new term accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.6.1.3       Search for MedDRA Term by List ====&lt;br /&gt;
The list search function allows the user to navigate the MedDRA dictionary using the hierarchical structure of the dictionary. Select the System Organ Class field to select a SOC.  &lt;br /&gt;
&lt;br /&gt;
Continue selecting through the hierarchy (HLGT, HLT, PT) until you have selected the Low-Level Term that matches the adverse event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click the '''Select''' icon next to the term you would like to assign or click the '''Cancel''' button to cancel the action and return to the previous page. The report will be updated with the new term accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 1.6.2       Causality Assessment using the WHO Scale ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once the MedDRA terminology for the event has been set, the report will be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the terminology will further allow the setting of causality per medication. Click on the '''WHO Causality''' menu option for the associated report you would like to set causality for.&lt;br /&gt;
&lt;br /&gt;
The system will open up the '''WHO Causality Assessment''' pop up form.&lt;br /&gt;
&lt;br /&gt;
The '''WHO Causality Assessment''' form displays the adverse event as reported by the clinician and/or reporter and the MedDRA Terminology that has been set for the event.&lt;br /&gt;
&lt;br /&gt;
The '''WHO Causality Assessment''' form also displays the list of medications that the patient was exposed to at the onset of the adverse event. &lt;br /&gt;
&lt;br /&gt;
The analyst can perform the following actions against each medication the patient was exposed to:&lt;br /&gt;
&lt;br /&gt;
·        Ignore the medication (the medication is definitely not responsible for the adverse event)&lt;br /&gt;
&lt;br /&gt;
·        Set causality for the medication&lt;br /&gt;
&lt;br /&gt;
==== 1.6.2.1       Ignoring the Medication ====&lt;br /&gt;
Ignoring the medication means that a causality assessment need not be set for that medication.&lt;br /&gt;
&lt;br /&gt;
To ignore assigning a WHO causality assessment for this medication, click the '''Ignore Medication''' icon. The system will assign '''Ignored''' as the causality term.&lt;br /&gt;
&lt;br /&gt;
==== 1.6.2.2       Set Causality ====&lt;br /&gt;
By clicking the '''Set Causality''' icon, the system will enable you to set causality for this medication.&lt;br /&gt;
&lt;br /&gt;
The system displays a series of questions for assigning the WHO causality term.&lt;br /&gt;
&lt;br /&gt;
Click the appropriate response (Yes or No) for question 1 and continue to respond to the first five questions.&lt;br /&gt;
&lt;br /&gt;
If responses to all five questions are '''Yes,''' the system will assign '''Certain''' as the causality term.&lt;br /&gt;
&lt;br /&gt;
Click the '''Set causality icon''' next to the causality assessment and the system will assign the term as Certain in the system.&lt;br /&gt;
&lt;br /&gt;
Click the '''Close''' button at any time to undo the action and return to the list reports.&lt;br /&gt;
&lt;br /&gt;
If any of the questions in the Certain category have a response of '''No''' the system will display questions for the Probable/Likely category.&lt;br /&gt;
&lt;br /&gt;
Continue this process until you have answered '''Yes''' to all questions in a specific category. This will result in the classification for that medication being set to that category.&lt;br /&gt;
&lt;br /&gt;
In the event you reach the '''Unassessable/Unclassified''' category, if one of the two questions asked in that category is answered as '''No,''' the system will trigger an alert.&lt;br /&gt;
&lt;br /&gt;
Once the term has been assigned click the '''Close''' button to continue. &lt;br /&gt;
&lt;br /&gt;
=== 1.6.3       Causality Assessment using the Naranjo Scale ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once the MedDRA terminology for the event has been set, the report will be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Setting the terminology will further allow the setting of causality per medication. Click on the '''Naranjo Causality''' menu for the associated report you would like to set causality for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will open up the '''Naranjo Causality Assessment''' pop up form.&lt;br /&gt;
&lt;br /&gt;
The '''Naranjo Causality Assessment''' form displays the adverse event as reported by the clinician and/or reporter and the MedDRA Terminology set.&lt;br /&gt;
&lt;br /&gt;
The '''Naranjo Causality Assessment''' form also displays the list of medications that the patient was exposed to at the onset of the adverse event. &lt;br /&gt;
&lt;br /&gt;
The analyst can perform the following actions against each medication the patient was exposed to:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·        Ignore the medication (the medication is definitely not responsible for the adverse event)&lt;br /&gt;
&lt;br /&gt;
·        Set causality for the medication&lt;br /&gt;
&lt;br /&gt;
==== 1.6.3.1       Ignoring the Medication ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ignoring the medication means that a causality assessment need not be set for that medication.&lt;br /&gt;
&lt;br /&gt;
To ignore assigning a Naranjo causality assessment for this medication, click the '''Ignore Medication''' icon. The system will assign '''Ignored''' as the causality term.&lt;br /&gt;
&lt;br /&gt;
==== 1.6.3.2       Set Causality ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By clicking the '''Set Causality''' icon, the system will enable you to set causality for this medication.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system displays a series of questions for calculating the Naranjo causality score.&lt;br /&gt;
&lt;br /&gt;
Click the appropriate response (Yes or No) for question 1 and continue to respond to all remaining questions.  Once all responses have been selected, the system will automatically calculate the causality assessment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click the '''Set causality icon''' next to the causality assessment and the system will assign the term as per the calculation in the system.&lt;br /&gt;
&lt;br /&gt;
Click the '''Close''' button at any time to undo the action and return to the list reports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== 1.6.4       Confirming Causality Set ===&lt;br /&gt;
The '''Set MedDRA and Causality''' stage facilitates the process of confirming the final MedDRA term for the adverse event and allows assignment of causality per relevant medication using either the World Health Organization or the Naranjo Causality Scale.&lt;br /&gt;
&lt;br /&gt;
Once causality for all medications has been set, the report will be updated accordingly. &lt;br /&gt;
&lt;br /&gt;
Click on the '''Confirm Causality Set''' menu for the associated report you would like to confirm causality set for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Confirm Causality Set''' form.&lt;br /&gt;
&lt;br /&gt;
Specify any comment if necessary and click '''Save''' to confirm the setting of the causality or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly. Please note the report will now be located in the Extract E2B tab.&lt;br /&gt;
&lt;br /&gt;
== 1.7        Pharmacovigilance Activities – Extract E2B ==&lt;br /&gt;
&lt;br /&gt;
=== 1.7.1       Create E2B ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''BUZZWORDS''' &lt;br /&gt;
&lt;br /&gt;
'''ICH E2B:''' An E2B dataset facilitates the Electronic Transmission of  Individual Case Safety Reports (ICSRs) and can be used to submit such reports  to WHO. The E2B dataset within PViMS is implemented using the standard  adopted by the ICH1 for electronic transmission of ICSRs according to the ICH  E2B(R3) message standard.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''Extract E2B''' stage generates an E2B extract for submission to the World Health Organization Uppsala Monitoring Centre.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;By  clicking this menu item, the system generates an E2B dataset that is populated  with clinical information from the source form. This E2B dataset can be  amended by you to reflect additional clinical information pertinent to WHO.  This menu item is only available for forms that are in the Extract E2B | NOTGENERATED  stage.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Once you have searched for a report, click on the '''Create E2B''' menu for the associated report you would like to create E2B for.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the system has created the E2B dataset, the status of the report will be updated to E2BINITIATED to indicate the dataset has been created.&lt;br /&gt;
&lt;br /&gt;
The E2B dataset is constructed with the following sections (these sections are based on R2 of the E2B ICH definition):&lt;br /&gt;
&lt;br /&gt;
·        Message Header&lt;br /&gt;
&lt;br /&gt;
·        Safety Report&lt;br /&gt;
&lt;br /&gt;
·        Primary Source&lt;br /&gt;
&lt;br /&gt;
·        Sender&lt;br /&gt;
&lt;br /&gt;
·        Receiver&lt;br /&gt;
&lt;br /&gt;
·        Patient&lt;br /&gt;
&lt;br /&gt;
·        Medical History Episode&lt;br /&gt;
&lt;br /&gt;
·        Past Drug Therapy&lt;br /&gt;
&lt;br /&gt;
·        Patient Death&lt;br /&gt;
&lt;br /&gt;
·        Reaction&lt;br /&gt;
&lt;br /&gt;
·        Test&lt;br /&gt;
&lt;br /&gt;
·        Drug&lt;br /&gt;
&lt;br /&gt;
·        Summary&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''ICH E2B:''' Please see the electronic  Transmission of Individual Case Safety Reports Message Specification for detail  specifications on the above categories. This specification can be found on &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://admin.ich.org/sites/default/files/inline-files/ICH_ICSR_Specification_V2-3.pdf&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== 1.7.2       Adding Information to and Updating an E2B File ===&lt;br /&gt;
Once an E2B file is created, the '''Update E2B''' menu allows the user to add information to or updating existing information populated in an E2B file.&lt;br /&gt;
&lt;br /&gt;
Once you have searched for a report, click on the '''Update E2B''' menu for the associated file you would like to amend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system will pop up a '''E2B ICH Report''' form for the file.&lt;br /&gt;
&lt;br /&gt;
Once you completed making amendments, click on the '''Save''' button to save the changes or the '''Cancel''' button to cancel the action and return to the previous page.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}  &lt;br /&gt;
&lt;br /&gt;
=== 1.7.3       Preparing a Report for E2B Submission ===&lt;br /&gt;
The '''Extract E2B''' stage facilitates the process of generating an E2B extract for submission to the World Health Organization Uppsala Monitoring Centre.&lt;br /&gt;
&lt;br /&gt;
Once you have created an E2B file and searched for the report, click on the '''Prepare Report for E2B Submission''' menu for the associated report you would like to prepare.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Prepare report for E2B submission''' pop up form.&lt;br /&gt;
&lt;br /&gt;
Specify any additional comments for preparing the record and click '''Save''' to confirm the preparation or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
&lt;br /&gt;
The system will update the status of the report accordingly.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|It  is during this stage that PViMS prepares the XML file for submission. It also  prepares an associated patient summary and patient extract that correspond to  the clinical data at the point of generating the submission.&lt;br /&gt;
&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
=== 1.7.4       Viewing the E2B XML File ===&lt;br /&gt;
Once you have prepared the E2B file for submission and searched for the report, click on the '''View Activity History''' menu for the associated report you would like to view the XML file for.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Activities''' page where you will be able to view a comprehensive history of activities by the analyst against this adverse event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Locate the '''E2BGENERATED''' execution event for the report, click the menu for that event, and select the '''Download E2B File''' menu.&lt;br /&gt;
&lt;br /&gt;
The system will automatically generate the XML file for the E2B submission to WHO. Save the file on your local computer for referral when sending to WHO.&lt;br /&gt;
&lt;br /&gt;
The extract below is the XML generated for the Message Header section of the XML file.  &lt;br /&gt;
&lt;br /&gt;
=== 1.7.5       Viewing the Clinical Data Associated to the E2B XML File ===&lt;br /&gt;
Once you have prepared the E2B file for submission and searched for the report, click on the '''View Activity History''' menu for the associated report you would like to view the XML file for.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Activities''' page where you will be able to view a comprehensive history of activities by the analyst against this adverse event.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Locate the '''E2BGENERATED''' execution event for the report, click the action menu, and select the '''Download summary or Download extract''' menu.&lt;br /&gt;
&lt;br /&gt;
If you select the '''Download summary''' menu, the system will generate a MS Word extract of the associated clinical data. See Extracting a Patient Summary.&lt;br /&gt;
&lt;br /&gt;
If you select the '''Download extract''' menu, the system will generate an MS Excel extract of the associated clinical data.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|In  both the Patient Extract and Summary above, these files are stored along with  the XML file as a reference to the clinical data associated with the XML file  at the point the XML file was generated.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.7.6       Confirming a Report for E2B Submission ===&lt;br /&gt;
Once you have prepared the E2B file for submission and searched for the report, click on the '''Confirm E2B Submission''' menu for the associated report you would like to submit.&lt;br /&gt;
&lt;br /&gt;
The system will navigate you to the '''Confirm E2B Submission''' pop up form.&lt;br /&gt;
&lt;br /&gt;
Specify any additional comments for confirming the submission and click '''Save''' to confirm the submission or '''Cancel''' to cancel the action and return to the previous page.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|The  receipt date and code can be used to note correspondence with WHO on the  receipt of the E2B XML submission file.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
The system will update the status of the report accordingly. Please note that the report is removed from the Extract E2B tab as work for this report is now classified as finished. Use the S'''earch by date''' or '''Search by term''' tabs to locate this report again.&lt;br /&gt;
&lt;br /&gt;
== 1.8        Analyser ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|This section is used to generate the relative risk  for a specified adverse drug reaction based on an exposed and non-exposed  population set over a defined period of time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The analyser user can access the following  functionality within the analytical portal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·          Define  population set (cohort or condition group)&lt;br /&gt;
&lt;br /&gt;
·          Define  reporting period&lt;br /&gt;
&lt;br /&gt;
·          Specify  additional risk factors&lt;br /&gt;
&lt;br /&gt;
·          View risk  ratios per exposed drug&lt;br /&gt;
&lt;br /&gt;
·          Download  dataset for further analysis&lt;br /&gt;
|}&lt;br /&gt;
'''2        '''&lt;br /&gt;
&lt;br /&gt;
2.1       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.2       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.3       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.4       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.5       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.6       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.7       ''' '''&lt;br /&gt;
&lt;br /&gt;
2.8       ''' '''&lt;br /&gt;
&lt;br /&gt;
=== 2.8.1       Methodology ===&lt;br /&gt;
The following formulas, calculations and definitions are used in the calculation of the relative risk for a specific medication and adverse reaction. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1.8.1.1       Incidence Rate ====&lt;br /&gt;
The incidence rate is the number of new cases per population in a given time period&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|IR = (ADR / Population) * 1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Where'''&lt;br /&gt;
&lt;br /&gt;
IR = Incidence  Rate&lt;br /&gt;
&lt;br /&gt;
ADR = Number of  adverse drug reactions *&lt;br /&gt;
&lt;br /&gt;
Population =  Total patient years in reporting period **&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; Where  causality is set to possible, probably/likely or Certain for WHO assessments  and where causality is set to possible, probable or definite for Naranjo  assessments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt; Population  is represented in patient years. For example, if the reporting period is 30  days, and 10 patients were on treatment for all 30 days, the total patient  years is 300 /365.25 which is 0.82.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
Cases = 11&lt;br /&gt;
&lt;br /&gt;
Non-Cases = 170&lt;br /&gt;
&lt;br /&gt;
Population =  181 (11 + 170)&lt;br /&gt;
&lt;br /&gt;
Incidence Rate  = 11/181 * 1000 = '''60.77'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 1.8.1.2       Relative Risk ====&lt;br /&gt;
Relative risk is defined as the incidence in the exposed over incidence in the non-exposed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|RR= IR1 / IR2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Where'''&lt;br /&gt;
&lt;br /&gt;
RR = Relative Risk&lt;br /&gt;
&lt;br /&gt;
IR1 = Incidence Rate for exposed population. The  exposed population is defined as the patient population that have been  exposed to a medication in the reporting period.&lt;br /&gt;
&lt;br /&gt;
IR2 = Incidence Rate for non-exposed population.  The exposed population is defined as the patient population that have NOT  been exposed to a medication in the reporting period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
Incidence Rate Exposed = 60.77&lt;br /&gt;
&lt;br /&gt;
Incidence Rate Non-Exposed = 45.12&lt;br /&gt;
&lt;br /&gt;
RR = '''1.35'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 1.8.1.3       Confidence Interval ====&lt;br /&gt;
A confidence interval is a range of values so defined that there is a specified probability that the value of a parameter lies within it. Most commonly, the 95% confidence interval is used.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
'''Where'''&lt;br /&gt;
&lt;br /&gt;
''z''&amp;lt;sub&amp;gt;α&amp;lt;/sub&amp;gt; is the  standard score for the chosen level of significance and SE the standard  error.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 1.8.2       Generating Unadjusted Relative Risk Ratios ===&lt;br /&gt;
To implement the methodology for generating an '''Unadjusted Relative Risk Ratio,''' the following parameters will need to be specified:&lt;br /&gt;
&lt;br /&gt;
·        The population target (condition group or Cohort)&lt;br /&gt;
&lt;br /&gt;
·        The date range for the analysis&lt;br /&gt;
&lt;br /&gt;
The '''Analyser''' function can be accessed through the main menu.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.1       Specifying the Population Group ====&lt;br /&gt;
Ensure the '''Analysis Criteria''' tab is selected to allow the selection of the patient population.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By selecting a '''Condition Group''' or '''Cohort''', you are effectively able to target a specific set of patients for analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Condition Group,''' click the Primary Condition Group Risk Factor field and select the primary condition you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Condition Group will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Cohort,''' click the Cohort field and select the primary cohort you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Cohort will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.2       Specifying the Date Range for the Analysis ====&lt;br /&gt;
By selecting a '''Date Range''', the system will determine which patients should be included into the analysis from the Patient Population specified in the previous step. Patients that have been actively exposed to medication within that range will be included.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.3       Running the Analysis ====&lt;br /&gt;
Once the '''Patient Population''' and '''Date Range''' parameters have been selected, click on the '''Analyse''' button to execute the analysis.&lt;br /&gt;
&lt;br /&gt;
The system will conduct an initial analysis that will identify what Adverse Drug Reactions have been identified over the reporting period. All results are included in the '''Analysis Results''' tab. Please note that only adverse drug reactions where a MedDRA term has been selected by the PV technician will be selected.&lt;br /&gt;
&lt;br /&gt;
Select the '''Adverse Drug Reaction''' that you would like to detect signals for by clicking on the tab for that reaction. The selected tab will turn a dark blue to signify that it has been selected.&lt;br /&gt;
&lt;br /&gt;
Please note that selecting the Adverse Drug Reaction will enable the Dashboard and Patients tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You are able to now view a 2 by 2 table illustrating relative risk and 95% Confidence Interval for the selected reaction.&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for exposed group&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for non-exposed group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
·        Relative Risk for the associated medication&lt;br /&gt;
&lt;br /&gt;
·        95% Confidence Interval for the associated medication &lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.4       Viewing the Contributing Patient List ====&lt;br /&gt;
Once analysis has been executed, it is possible to view the list of patients that have contributed to the analysis population set through the '''Patients''' tab.&lt;br /&gt;
&lt;br /&gt;
The columns in the patient list table are described below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Patient name&lt;br /&gt;
|The name of the patient  contributing to the patient population&lt;br /&gt;
|-&lt;br /&gt;
|Medication&lt;br /&gt;
|The drug the patient  was exposed to during the period of analysis&lt;br /&gt;
|-&lt;br /&gt;
|Days  contributed&lt;br /&gt;
|The number of days the  patient contributed to the patient population&lt;br /&gt;
|-&lt;br /&gt;
|Reaction&lt;br /&gt;
|Did the patient suffer  a reaction during the period of analysis&lt;br /&gt;
|-&lt;br /&gt;
|Risk Factor&lt;br /&gt;
|Which risk factor does  the patient match&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 1.8.2.5       Resetting Criteria ====&lt;br /&gt;
If at any point you would like to alter the patient population or date range, click the '''Reset criteria''' tab alongside the list of Adverse Drug Reactions to reset analysis. Selecting this tab will remove existing analysis and reopen the Analysis Criteria tab for modification.&lt;br /&gt;
&lt;br /&gt;
=== 1.8.3       Generating Adjusted Relative Risk Ratios ===&lt;br /&gt;
To implement the methodology for generating an '''Adjusted Relative Risk Ratio,''' the following parameters will need to be specified:&lt;br /&gt;
&lt;br /&gt;
·        The population target (condition group or Cohort)&lt;br /&gt;
&lt;br /&gt;
·        The date range for the analysis&lt;br /&gt;
&lt;br /&gt;
·        The risk factors to be applied&lt;br /&gt;
&lt;br /&gt;
The '''Analyser''' function can be accessed through the main menu.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.3.1       Specifying the Population Group ====&lt;br /&gt;
Ensure the '''Analysis Criteria''' tab is selected to allow the selection of the patient population.&lt;br /&gt;
&lt;br /&gt;
By selecting a '''Condition Group''' or '''Cohort''', you are effectively able to target a specific set of patients for analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Condition Group,''' click the Primary Condition Group Risk Factor field and select the primary condition you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Condition Group will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
To specify a '''Cohort,''' click the Cohort field and select the primary cohort you would like to run analysis against. If this option is selected, all patients that belong to the corresponding Cohort will be included in the analysis.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.3.2       Specifying the Date Range for the Analysis ====&lt;br /&gt;
By selecting a '''Date Range''', the system will determine which patients should be included into the analysis from the Patient Population specified in the previous step. Patients that have been actively exposed to medication within that range will be included. &lt;br /&gt;
==== 1.8.3.3       Specifying Risk Factors for the Analysis ====&lt;br /&gt;
&lt;br /&gt;
To specify a '''Risk Factor,''' click the Risk factor field and select the risk factor you would like to include into the analysis. Once you have selected the risk factor, select the appropriate option associated to that risk factor and click the '''add''' icon to add the risk factor to the selected list.&lt;br /&gt;
&lt;br /&gt;
You are able to add as many risk factors as you would like to include into the analysis by repeating the above process.&lt;br /&gt;
&lt;br /&gt;
By including '''Risk Factors''' into the analysis, the system will determine which patients match the criteria stipulated by the set of risk factors and the corresponding '''Relative Risk Ratio''' will be adjusted based on the new population set.&lt;br /&gt;
&lt;br /&gt;
==== 1.8.3.4       Running the Analysis ====&lt;br /&gt;
Once the '''Patient Population, Date Range, and Risk Factor''' parameters have been selected, click on the '''Analyse''' button to execute the analysis.&lt;br /&gt;
&lt;br /&gt;
The system will conduct an initial analysis that will identify what Adverse Drug Reactions have been identified over the reporting period. All results are included in the '''Analysis Results''' tab. Please note that only adverse drug reactions where a MedDRA term has been selected by the PV technician will be selected.&lt;br /&gt;
&lt;br /&gt;
Select the '''Adverse Drug Reaction''' that you would like to detect signals for by clicking on the tab for that reaction. The selected tab will turn a dark blue to signify that it has been selected.&lt;br /&gt;
&lt;br /&gt;
Please note that selecting the Adverse Drug Reaction will enable the Dashboard and Patients tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You are able to now view a 2 by 2 table illustrating relative risk and 95% Confidence Interval for the selected reaction.&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for exposed group&lt;br /&gt;
&lt;br /&gt;
·        Incidence Rate for non-exposed group&lt;br /&gt;
&lt;br /&gt;
·        Relative Risk for the associated medication&lt;br /&gt;
&lt;br /&gt;
·        95% Confidence Interval for the associated medication  &lt;br /&gt;
=== 1.8.4       Downloading a Dataset for Further Analysis ===&lt;br /&gt;
Select the '''Download Data''' tab and then click the '''Download Dataset''' button to able to download a comprehensive dataset of patient clinical data in XLSX format for importation into a third-party statistical tool.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
|If  you are unable to locate this function, please liaise with your system  administrator as the ability to download a dataset for external consumption will  need to be assigned to your user profile.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=153</id>
		<title>OpenRIMS-RPM - Upgrade Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=153"/>
		<updated>2023-08-31T18:44:19Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Objective =&lt;br /&gt;
A new release of OpenRIMS always contains changes in the software codes and, very often, in the database structure. To install a new release, it is necessary to replace the software codes and implement the database structure changes, if ones.&lt;br /&gt;
&lt;br /&gt;
The implementation of the database structure changes will keep all data, however, will allow the use of the new release of the software.&lt;br /&gt;
&lt;br /&gt;
Despite it being possible to use this feature for the production databases, it is recommended only for test and demo systems.&lt;br /&gt;
&lt;br /&gt;
Here are the steps to perform an upgrade from any version of OpenRIMS to latest version.&lt;br /&gt;
&lt;br /&gt;
# Connect to destination server UI or CLI&lt;br /&gt;
# Backup Database&lt;br /&gt;
# Download the new MySQL model file&lt;br /&gt;
# Stop the OpenRIMS service&lt;br /&gt;
# Rename old Application file&lt;br /&gt;
# Download the new Application file (https://github.com/MSH/OpenRIMS/raw/main/bin/pharmadex2-0.0.1.jar)&lt;br /&gt;
# Change Permissions on the .jar file to make it executable: sudo chmod -x pharmadex2-0.0.1.jar&lt;br /&gt;
# Use Workbench to upgrade db structure based on the model - see below&lt;br /&gt;
# Start the OpenRIMS service&lt;br /&gt;
&lt;br /&gt;
= Tool =&lt;br /&gt;
               The tool is the latest version of MySQL Workbench.&lt;br /&gt;
&lt;br /&gt;
               For current, the latest stable release of the database is in pdx2demo.ddanet.org. To upgrade the database in any other server, or, even, in the localhost it is possible to use the feature “Model – Synchronize with any source” (&amp;lt;nowiki&amp;gt;https://dev.mysql.com/doc/workbench/en/wb-database-synchronization.html&amp;lt;/nowiki&amp;gt;) provided by the MySQL Workbench.&lt;br /&gt;
&lt;br /&gt;
               This feature:&lt;br /&gt;
&lt;br /&gt;
1.      reads the latest and the current database structures,&lt;br /&gt;
&lt;br /&gt;
2.      compares them&lt;br /&gt;
&lt;br /&gt;
3.      creates a script to upgrade the current database to the latest database structure&lt;br /&gt;
&lt;br /&gt;
4.      executes this script&lt;br /&gt;
&lt;br /&gt;
               The result is the equal data structures for the latest and the current database. The data is still the same as was before.&lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
= Pre-condition =&lt;br /&gt;
               You should have full access rights to your database and add the connection to the latest database depicted below. Ask for a password by email to alex.kurasoff@gmail.com.&lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
Figure 1. The connection to the latest database&lt;br /&gt;
&lt;br /&gt;
= The sequence of steps =&lt;br /&gt;
               Suppose you need to update the database structure of a database on the localhost.&lt;br /&gt;
&lt;br /&gt;
Figure 2. Create a '''new''' model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 3. Run the feature&lt;br /&gt;
&lt;br /&gt;
Figure 4. The representation of the feature is a &amp;quot;wizard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 5. Tap the radio buttons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 6. The latest database is on pdx2demo.ddanet.org. It is the source of the changes&lt;br /&gt;
&lt;br /&gt;
Figure 7. Suppose the database going to be updated is in the localhost. It is the target of the changes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 8. Extract the list of all sources and all target databases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 9. Select the source database. The target database is at the bottom of the screen. By default, the names of the target and the source should be the same &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 10. Compare the source and the target&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 11. Revise the changes.&lt;br /&gt;
&lt;br /&gt;
Figure 12. The result DDA SQL script. There are no changes&lt;br /&gt;
&lt;br /&gt;
= Linux particularities =&lt;br /&gt;
               The MySQL database usage in Windows and Linux servers is slightly different. In the Linux server, the names of tables are cases sensitive, on Windows – no. There is any problem if the source server is under Linux, and the target server is under Windows. Otherwise, the tables SPRING_SESSION and SPRING_SESSION attributes should be ignored while synchronization. There are special tables that are in use by third-party software.&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=152</id>
		<title>OpenRIMS-RPM - Upgrade Part 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-RPM_-_Upgrade_Part_1&amp;diff=152"/>
		<updated>2023-08-31T16:04:33Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Objective =&lt;br /&gt;
A new release of OpenRIMS always contains changes in the software codes and, very often, in the database structure. To install a new release, it is necessary to replace the software codes and implement the database structure changes, if ones.&lt;br /&gt;
&lt;br /&gt;
The implementation of the database structure changes will keep all data, however, will allow the use of the new release of the software.&lt;br /&gt;
&lt;br /&gt;
Despite it being possible to use this feature for the production databases, it is recommended only for test and demo systems.&lt;br /&gt;
&lt;br /&gt;
Here are the steps to perform an upgrade from any version of OpenRIMS to latest version.&lt;br /&gt;
&lt;br /&gt;
# Connect to destination server UI or CLI&lt;br /&gt;
# Backup Database&lt;br /&gt;
# Download the new MySQL model file&lt;br /&gt;
# Stop the OpenRIMS service&lt;br /&gt;
# Rename old Application file&lt;br /&gt;
# Download the new Application file (https://github.com/MSH/OpenRIMS/raw/main/bin/pharmadex2-0.0.1.jar)&lt;br /&gt;
# Change Permissions on the .jar file to make it executable&lt;br /&gt;
# Use Workbench to upgrade db structure based on the model - see below&lt;br /&gt;
# Start the OpenRIMS service&lt;br /&gt;
&lt;br /&gt;
= Tool =&lt;br /&gt;
               The tool is the latest version of MySQL Workbench.&lt;br /&gt;
&lt;br /&gt;
               For current, the latest stable release of the database is in pdx2demo.ddanet.org. To upgrade the database in any other server, or, even, in the localhost it is possible to use the feature “Model – Synchronize with any source” (&amp;lt;nowiki&amp;gt;https://dev.mysql.com/doc/workbench/en/wb-database-synchronization.html&amp;lt;/nowiki&amp;gt;) provided by the MySQL Workbench.&lt;br /&gt;
&lt;br /&gt;
               This feature:&lt;br /&gt;
&lt;br /&gt;
1.      reads the latest and the current database structures,&lt;br /&gt;
&lt;br /&gt;
2.      compares them&lt;br /&gt;
&lt;br /&gt;
3.      creates a script to upgrade the current database to the latest database structure&lt;br /&gt;
&lt;br /&gt;
4.      executes this script&lt;br /&gt;
&lt;br /&gt;
               The result is the equal data structures for the latest and the current database. The data is still the same as was before.&lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
= Pre-condition =&lt;br /&gt;
               You should have full access rights to your database and add the connection to the latest database depicted below. Ask for a password by email to alex.kurasoff@gmail.com.&lt;br /&gt;
&lt;br /&gt;
              &lt;br /&gt;
&lt;br /&gt;
Figure 1. The connection to the latest database&lt;br /&gt;
&lt;br /&gt;
= The sequence of steps =&lt;br /&gt;
               Suppose you need to update the database structure of a database on the localhost.&lt;br /&gt;
&lt;br /&gt;
Figure 2. Create a '''new''' model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 3. Run the feature&lt;br /&gt;
&lt;br /&gt;
Figure 4. The representation of the feature is a &amp;quot;wizard&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 5. Tap the radio buttons&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 6. The latest database is on pdx2demo.ddanet.org. It is the source of the changes&lt;br /&gt;
&lt;br /&gt;
Figure 7. Suppose the database going to be updated is in the localhost. It is the target of the changes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 8. Extract the list of all sources and all target databases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 9. Select the source database. The target database is at the bottom of the screen. By default, the names of the target and the source should be the same &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 10. Compare the source and the target&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 11. Revise the changes.&lt;br /&gt;
&lt;br /&gt;
Figure 12. The result DDA SQL script. There are no changes&lt;br /&gt;
&lt;br /&gt;
= Linux particularities =&lt;br /&gt;
               The MySQL database usage in Windows and Linux servers is slightly different. In the Linux server, the names of tables are cases sensitive, on Windows – no. There is any problem if the source server is under Linux, and the target server is under Windows. Otherwise, the tables SPRING_SESSION and SPRING_SESSION attributes should be ignored while synchronization. There are special tables that are in use by third-party software.&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Upgrade_Chapter_1&amp;diff=151</id>
		<title>OpenRIMS-PVM - Upgrade Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Upgrade_Chapter_1&amp;diff=151"/>
		<updated>2023-08-24T19:33:12Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: New page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
New versions will be released on GitHub: https://github.com/msh/openrims-pvm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To upgrade to the latest version you must follow these steps:&lt;br /&gt;
&lt;br /&gt;
# Backup the database&lt;br /&gt;
# Stop the service&lt;br /&gt;
# Copy APP and API folders to a backup destination&lt;br /&gt;
# With that in place you can now:&lt;br /&gt;
## Download the new APP and API files&lt;br /&gt;
## Extract&lt;br /&gt;
## Copy to the web server folder; typically /var/www/html/'''api''' and /var/www/html/'''app'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---End of document---&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=150</id>
		<title>OpenRIMS-PVM - Installation Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Installation_Chapter_1&amp;diff=150"/>
		<updated>2023-08-21T18:59:13Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide describes the deployment for a '''MySQL''' Linux server i.e. Ubuntu for the below instructions.&lt;br /&gt;
&lt;br /&gt;
Please click this link for an MSSQL deployment.&lt;br /&gt;
&lt;br /&gt;
== Pre-Requisites ==&lt;br /&gt;
You need a server to install on. Local or Cloud.&lt;br /&gt;
&lt;br /&gt;
In this example we are deploying on an Oracle OCI server.&lt;br /&gt;
&lt;br /&gt;
The server is accessed using SSH.&lt;br /&gt;
&lt;br /&gt;
== Basic Web Server Setup ==&lt;br /&gt;
 sudo apt update&lt;br /&gt;
&lt;br /&gt;
 sudo apt install apache2&lt;br /&gt;
Then enable Proxy which will be used for the .Net api:&lt;br /&gt;
 a2enmod proxy proxy_http proxy_html&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
Oracle OCI specific:&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 3306 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
 sudo netfilter-persistent save&lt;br /&gt;
&lt;br /&gt;
== '''Basic MySQL Setup''' ==&lt;br /&gt;
 sudo apt install mysql-server&lt;br /&gt;
&lt;br /&gt;
 sudo mysql&lt;br /&gt;
Configure root user password:&lt;br /&gt;
 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';&lt;br /&gt;
Create database user named ''openrimspvm'' with your ''password'' of choice:&lt;br /&gt;
 CREATE USER 'openrimspvm'@'%' IDENTIFIED BY 'password';&lt;br /&gt;
Give the user access to the database with the name you have chosen/defined (in appsettings.json - see later section):&lt;br /&gt;
 GRANT PRIVILEGE ON pvims TO 'openrimspvm'@'%';&lt;br /&gt;
Or full access to database (only if remote access is disabled for better security):&lt;br /&gt;
 GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;&lt;br /&gt;
&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
== '''.NET Core 6 Runtime''' ==&lt;br /&gt;
 curl -SL -o dotnet.tar.gz &amp;lt;nowiki&amp;gt;https://download.visualstudio.microsoft.com/download/pr/33c6e1e3-e81f-44e8-9de8-91934fba3c94/9105f95a9e37cda6bd0c33651be2b90a/dotnet-sdk-6.0.201-linux-arm64.tar.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir -p /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet&lt;br /&gt;
&lt;br /&gt;
== '''APP and API''' ==&lt;br /&gt;
Please send an email to info@openrims.org to download the required files.&amp;lt;blockquote&amp;gt;TIP - Install Midnight Commander for easy file navigation in the Linux commandline: &lt;br /&gt;
&lt;br /&gt;
sudo apt install mc (Install midnight commander for file management and permissions)&amp;lt;/blockquote&amp;gt;wget zip files for each app and api (from openrims.org/GitHub)&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/app using mc&lt;br /&gt;
&lt;br /&gt;
Unzip to /var/www/html/api using mc&lt;br /&gt;
&lt;br /&gt;
Make dll application file in the API folder executable:&lt;br /&gt;
 sudo chmod -x PViMS.API.dll&lt;br /&gt;
Edit appsettings.json connection string to MySQL with password:&lt;br /&gt;
 sudo nano /var/www/html/api/appsettings.json&lt;br /&gt;
Test API with direct dotnet command:&lt;br /&gt;
 dotnet PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
* Check for red text errors in the CLI window e.g. wrong database connection&lt;br /&gt;
* Check that the database has been created in MySQL&lt;br /&gt;
&lt;br /&gt;
Stop dotnet with Ctrl+C&lt;br /&gt;
&lt;br /&gt;
== '''Configure the Service''' ==&lt;br /&gt;
We need auto start in case of reboot&lt;br /&gt;
 cd /etc/systemd/system&lt;br /&gt;
&lt;br /&gt;
 sudo nano openrimspvm.service&lt;br /&gt;
The system file must contain something like: &amp;lt;blockquote&amp;gt;[Unit]&lt;br /&gt;
&lt;br /&gt;
Description=Example .NET Web API App OpenRIMS-PVM running on Linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
&lt;br /&gt;
WorkingDirectory=/var/www/html/api&lt;br /&gt;
&lt;br /&gt;
ExecStart=/usr/bin/dotnet /var/www/html/api/PViMS.API.dll&lt;br /&gt;
&lt;br /&gt;
Restart=always&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt; Restart service after 10 seconds if the dotnet service crashes:&lt;br /&gt;
&lt;br /&gt;
RestartSec=10&lt;br /&gt;
&lt;br /&gt;
KillSignal=SIGINT&lt;br /&gt;
&lt;br /&gt;
SyslogIdentifier=dotnet-example&lt;br /&gt;
&lt;br /&gt;
User=www-data&lt;br /&gt;
&lt;br /&gt;
Environment=ASPNETCORE_ENVIRONMENT=Production&lt;br /&gt;
&lt;br /&gt;
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
&lt;br /&gt;
WantedBy=multi-user.target&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
 sudo systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl start openrimspvm.service&lt;br /&gt;
&lt;br /&gt;
 sudo systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
== '''Secure The Website''' ==&lt;br /&gt;
sudo nano /etc/apache2/sites-enabled/000-default.conf&lt;br /&gt;
&lt;br /&gt;
Sample content with app and api:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        ServerName '''subdomain-api'''.openrims.org&lt;br /&gt;
&lt;br /&gt;
        DocumentRoot /var/www/html/api&lt;br /&gt;
&lt;br /&gt;
        ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
        CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then apply SSL:&lt;br /&gt;
 sudo apt install certbot python3-certbot-apache&lt;br /&gt;
&lt;br /&gt;
 sudo certbot&lt;br /&gt;
&lt;br /&gt;
== '''Webserver Config''' ==&lt;br /&gt;
We need to separate secure vhost: One for APP and one for API&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect to APP&lt;br /&gt;
&lt;br /&gt;
Vhost on 443 pointing to APP (Then API as &amp;lt;Location /&amp;gt; with reverse proxy?)&lt;br /&gt;
&lt;br /&gt;
Vhost on port 80 for redirect API&lt;br /&gt;
&lt;br /&gt;
This one is just a reverse proxy to port 5000 where Kestrel is running the dotnet PViMS.API.dll&lt;br /&gt;
 sudo nano /etc/apache2/sites-enabled/000-default-le-ssl.conf&lt;br /&gt;
SAMPLE Apache .conf file:&amp;lt;blockquote&amp;gt;&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName pv.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       DocumentRoot /var/www/html/app&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       '''ServerName''' '''pv-api.openrims.org'''&lt;br /&gt;
&lt;br /&gt;
       ErrorLog ${APACHE_LOG_DIR}/error.log&lt;br /&gt;
&lt;br /&gt;
       CustomLog ${APACHE_LOG_DIR}/access.log combined&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Location /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPreserveHost On&lt;br /&gt;
&lt;br /&gt;
              ProxyPass &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
              ProxyPassReverse &amp;lt;nowiki&amp;gt;http://0.0.0.0:5000/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
      &amp;lt;/Location&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
&lt;br /&gt;
SSLCertificateFile /etc/letsencrypt/live/pv-api.openrims.org/fullchain.pem&lt;br /&gt;
&lt;br /&gt;
SSLCertificateKeyFile /etc/letsencrypt/live/pv-api.openrims.org/privkey.pem&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&amp;lt;/blockquote&amp;gt;This Concludes the guide!&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=149</id>
		<title>OpenRIMS-PVM - Causality &amp; Terminology Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=149"/>
		<updated>2023-08-18T18:10:50Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Outcome B: Setting Causality and  Terminology for a Report */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Outcome A: Confirming Quality of Report  Data ==&lt;br /&gt;
Determining if the report  has sufficient quality of data to enable setting causality and terminology by  the PV team&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying new adverse event reports that have been submitted  by a facility''' ===&lt;br /&gt;
Reports that have been  submitted within a specified timeframe will be designated as new and appear  in the '''New Report''' tab. Reports will remain in this tab for a period of  2 days, irrespective if any updates have been applied to the report.&lt;br /&gt;
[[File:NewReportTab01.png.png|alt=NewReportTab01.png|frameless|500x500px]][[File:NewReportTab02.png.png|alt=NewReportTab02.png|'''Benefits of the New Reports tab'''This tab is useful to  easily identify reports that have recently been submitted.  It can be used to ensure there is  sufficient resource to respond to each report and to initiate the process of  event management between the PV team and the facility clinician who reported  the event.&lt;br /&gt;
&lt;br /&gt;
'''New Reports time frame'''&lt;br /&gt;
&lt;br /&gt;
It is possible to confirm the period of what constitutes a new report in the administration section of  PViMS. The default setting is 2 days from date of report submission.&lt;br /&gt;
&lt;br /&gt;
|thumb|300x300px|none]]'''Step 2: View clinical details associated to the report'''&lt;br /&gt;
&lt;br /&gt;
Once you have identified  that a new report has been created in PViMS, the process of confirming if the  report is of sufficient quality to allow the setting of causality and  terminology can begin. Clinical details associated to the adverse event can  be viewed using the '''View Details''' or '''Patient Summary''' menu  options that appear alongside the corresponding report.&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to view in the '''Confirm  Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will either display  details associated to the report within PViMS or download a patient summary  MS Word Document&lt;br /&gt;
[[File:PatientSummaryTab01.png.png|alt=PatientSummaryTab01.png|thumb|'''Benefits of the Patient Summary.'''Producing a patient summary provides you with a physical file that can be emailed separately from within the system. This may allow you to share details of the report without designated recipients needing access to PViMS.|none|405x405px]]&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Generating tasks per issue of data quality'''&lt;br /&gt;
&lt;br /&gt;
Data inconsistencies or  lack of sufficient data invariably has a multi-faceted impact on the time  taken to determine causality, the strength and accuracy of the causality  determined and will ultimately negatively affect the ability of the national  PV team to assist the clinician in the management of the event. The primary  function of the '''Confirm Report Data''' stage is to expedite the process  of assuring data quality and to ensure there is ongoing training and  communication with the facility to improve clinical record keeping.     &lt;br /&gt;
&lt;br /&gt;
A key tool in the  confirmation process is the ability to create data quality tasks for the  associated report. To add a task,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to add a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon[[File:Creating a Task.png|alt=Creating a Task|none|thumb|700x700px|Creating a Task]]&lt;br /&gt;
# Navigate to the corresponding  menu and select that item&lt;br /&gt;
# The system will navigate  you to a form that lists existing tasks that have been allocated to the  report (Please note that if this is the first task for the report you will be  notified of this)[[File:CreateTask02.png.png|alt=CreateTask02.png|none|thumb|684x684px|Create Task 2]]&lt;br /&gt;
# Select the '''Add Task''' button  to add a new task.&lt;br /&gt;
# Enter details of the task noting that the form area is a generic area of the report where the data  quality issue lies, and the type of task can be used to indicate if there is  a data quality issue or a general follow up on the report required. Enter details of the issue or follow up in the details tab.&lt;br /&gt;
# Select the '''Save''' button  to save the task for the adverse event report.[[File:CreateTask03.png.png|alt=CreateTask03.png|none|thumb|450x450px|Save the Task.]]&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using tasks to initiate follow up with the clinician''' &lt;br /&gt;
&lt;br /&gt;
Generating a task will  result in two notifications been sent. The first notification takes the form of an email that is sent to the  reporting clinician containing details of the report and the task that has been created. The second notification takes the form of an internal PViMS  notification that is sent to the system user that registered the report, this  includes a system notification to EDRWeb.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 4: Tracking tasks using its status and adding comments to the  task''' ===&lt;br /&gt;
The key to expediting the data quality assurance process is to improve the process of fixing data  quality issues through improved communication between the facility clinician  and the PV technician. The ability to track task the task becomes critical in this regard.&lt;br /&gt;
&lt;br /&gt;
To change the status of a task:&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task''' for in the '''Confirm Report Data''' table.&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon.&lt;br /&gt;
# Navigate to the corresponding menu and select that item.[[File:Creating a Task.png|alt=Creating a Task.png|none|thumb|700x700px|Tracking a Task]]&lt;br /&gt;
# [[File:Tracking Tasks.png|alt=TrackingTasks02.png|none|thumb|450x450px|Tracking Tasks]]The system will navigate you to a form that lists existing tasks that have been allocated to the report.&lt;br /&gt;
# [[File:ChangeTaskStatus.png.png|alt=ChangeTaskStatus.png|none|thumb|450x450px|Changing Task Status]]Mouse over the menu item at the end of the task and select this icon.&lt;br /&gt;
# Navigate to the  corresponding menu and select that item.&lt;br /&gt;
# [[File:ConfirmTaskChange.png.png|alt=ConfirmTaskChange.png|none|thumb|450x450px|Confirm Task Change]]The system will pop up a  form where the status of a task can be changed.&lt;br /&gt;
# The following task  statuses apply:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Acknowledge Task&lt;br /&gt;
|The clinician can acknowledge that they have    received the task&lt;br /&gt;
|-&lt;br /&gt;
|On Hold&lt;br /&gt;
|The Task has not been cancelled but can be put    on hold&lt;br /&gt;
|-&lt;br /&gt;
|Cancel&lt;br /&gt;
|The task is cancelled and no follow up is    required&lt;br /&gt;
|-&lt;br /&gt;
|Completed&lt;br /&gt;
|The task has been completed and addressed&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using tasks to track efficiency of data  quality processes'''&lt;br /&gt;
&lt;br /&gt;
A task forms a  fundamentally useful mechanism for determining efficacy of data quality processes  centrally and at facility level. Useful metrics such as the number of tasks  per report per facility allow us to determine if a facility needs additional  intervention in the form of training or resources. Other metrics such as time  taken to complete a task may also indicate a new for improved communication  and resourcing.&amp;lt;/blockquote&amp;gt;Comments can be used to  facilitate ongoing communication between the PV technician and the reporting  clinician. To add a comment to a report:&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to add a '''Task''' for in the '''Confirm Report Data''' table.&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon.[[File:Creating a Task.png|alt=Open the Task screen|none|thumb|700x700px|Open the Task screen]]&lt;br /&gt;
# Navigate to the corresponding menu and select that item.&lt;br /&gt;
# The system will navigate you to a form that lists existing tasks that have been allocated to the report.&lt;br /&gt;
# Mouse over the menu item at the end of the task and select this icon.&lt;br /&gt;
# Navigate to the corresponding menu and select that item.&lt;br /&gt;
# The system will pop up a form where comments can be added to the report.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using comments effectively to communicate  between the PV team and the clinician'''&lt;br /&gt;
&lt;br /&gt;
Comments are useful in  that they facilitate communication between the PV team and the clinician.  While comments should be used judiciously, they indicate there is activity on  the task and forms an effective audit trail for activity on the task for all  to see.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 5: Confirming report is of sufficient quality to proceed''' ===&lt;br /&gt;
A report may only move  into the causality and terminology phase by confirming the report is of  sufficient quality to proceed. It is very important to note that once a  report is confirmed, it is expected that the report is of sufficient quality  to proceed.&lt;br /&gt;
&lt;br /&gt;
Confirmation that a  report has successfully passed the '''Confirm Data''' stage can be achieved  by,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Confirm Report'''&lt;br /&gt;
# The system will pop up a  form asking the user to confirm if the report is ready for confirmation&lt;br /&gt;
# Enter any comments if  necessary and select the '''Save''' button to confirm the report&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Confirm data for a report'''&lt;br /&gt;
&lt;br /&gt;
Confirming the report  will effectively move the report into the Causality and Terminology tab&lt;br /&gt;
&lt;br /&gt;
'''Deleting a report'''&lt;br /&gt;
&lt;br /&gt;
A report should only be deleted  if it is determined to be a duplicate or was incorrectly captured in the  clinical system&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Outcome B: Setting Causality and  Terminology for a Report ==&lt;br /&gt;
Setting causality using  either the MedDRA or Naranjo scale and determining the MedDRA term for the  adverse event&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying adverse event reports that are set for causality  and terminology''' ===&lt;br /&gt;
Reports that have been confirmed  will now appear in the '''Set MedDRA and Causality''' tab. Reports will  remain in this tab until causality and terminology has been completed.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 2: Setting the MedDRA term for a report'''MedDRA is the Medical  Dictionary for Regulatory Activities and is a clinically validated  international medical terminology dictionary-thesaurus used by regulatory  authorities and the biopharmaceutical industry during the regulatory process. ===&lt;br /&gt;
Once a report is moved  into the Set MedDRA and Causality phase, the first step is to set the MedDRA  term for the report. To set the term,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Terminology'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Set Terminology'''&lt;br /&gt;
# The system will pop up a  form where the MedDRA term can be set for the report&lt;br /&gt;
# It is possible to search  for a MedDRA term using 3 different methods.&lt;br /&gt;
#* '''Method 1''' allows for searching for the at the corresponding level you select.  For instance, you can search all Low-Level Terms which include the term you  are searching for. This is the most efficient method for searching for a  term.&lt;br /&gt;
#* '''Method 2''' allows for searching for the term by its associated code. This method  is primarily useful if you know the code you are searching for.&lt;br /&gt;
#* '''Method 3''' allows for searching for the term using the hierarchical structure of  MedDRA. This is the most precise way of searching through MedDRA but is also  the most time consuming.&lt;br /&gt;
# Once you have located the  term you have searched for, select the send icon next to the corresponding  term. This will set the term for the report.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Benefits of allocating a MedDRA term to a  report'''&lt;br /&gt;
&lt;br /&gt;
By allocating a MedDRA  term to the report, this endeavors to facilitate the exchange of clinical  information through a single standardized international medical terminology  that can be used for regulatory communication and evaluation of data  pertaining to medicinal products for human use.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 3: Setting causality per medication''' ===&lt;br /&gt;
Causality assessment essentially means finding a causal association or relationship between a drug  and a drug reaction. It is an evaluation of the likelihood that a particular treatment is the cause of an observed adverse event.&lt;br /&gt;
&lt;br /&gt;
Once a report is moved into the Set MedDRA and Causality phase, after the MedDRA term for the report is set, the second step is to set causality per medication the patient has been exposed to. To set causality using the Naranjo scale,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Causality'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon&lt;br /&gt;
# Navigate to the corresponding menu and select '''Naranjo Causality'''&lt;br /&gt;
# The system will pop up a form where causality can be set per medication&lt;br /&gt;
# To set causality for a specific medication, select the blue send icon for the corresponding  medication, after which you will be navigated to a form where you can set  causality for the medication using the Naranjo scale&lt;br /&gt;
# Answer each question in turn and once all questions are answered, the user will be presented with the  associated causality based on the answers provided&lt;br /&gt;
# Select the '''Save button''' to save causality for the medication&lt;br /&gt;
# You can view causality set per medication using the '''View Button''' &lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Benefits of setting causality per medication'''&lt;br /&gt;
&lt;br /&gt;
Once causality has been set, PViMS is able to detect signals based on patient exposure rates per medication.&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=148</id>
		<title>OpenRIMS-PVM - Causality &amp; Terminology Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=148"/>
		<updated>2023-08-18T15:12:21Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Step 5: Confirming report is of sufficient quality to proceed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Outcome A: Confirming Quality of Report  Data ==&lt;br /&gt;
Determining if the report  has sufficient quality of data to enable setting causality and terminology by  the PV team&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying new adverse event reports that have been submitted  by a facility''' ===&lt;br /&gt;
Reports that have been  submitted within a specified timeframe will be designated as new and appear  in the '''New Report''' tab. Reports will remain in this tab for a period of  2 days, irrespective if any updates have been applied to the report.&lt;br /&gt;
[[File:NewReportTab01.png.png|alt=NewReportTab01.png|frameless|500x500px]][[File:NewReportTab02.png.png|alt=NewReportTab02.png|'''Benefits of the New Reports tab'''This tab is useful to  easily identify reports that have recently been submitted.  It can be used to ensure there is  sufficient resource to respond to each report and to initiate the process of  event management between the PV team and the facility clinician who reported  the event.&lt;br /&gt;
&lt;br /&gt;
'''New Reports time frame'''&lt;br /&gt;
&lt;br /&gt;
It is possible to confirm the period of what constitutes a new report in the administration section of  PViMS. The default setting is 2 days from date of report submission.&lt;br /&gt;
&lt;br /&gt;
|thumb|300x300px|none]]'''Step 2: View clinical details associated to the report'''&lt;br /&gt;
&lt;br /&gt;
Once you have identified  that a new report has been created in PViMS, the process of confirming if the  report is of sufficient quality to allow the setting of causality and  terminology can begin. Clinical details associated to the adverse event can  be viewed using the '''View Details''' or '''Patient Summary''' menu  options that appear alongside the corresponding report.&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to view in the '''Confirm  Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will either display  details associated to the report within PViMS or download a patient summary  MS Word Document&lt;br /&gt;
[[File:PatientSummaryTab01.png.png|alt=PatientSummaryTab01.png|thumb|'''Benefits of the Patient Summary.'''Producing a patient summary provides you with a physical file that can be emailed separately from within the system. This may allow you to share details of the report without designated recipients needing access to PViMS.|none|405x405px]]&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Generating tasks per issue of data quality'''&lt;br /&gt;
&lt;br /&gt;
Data inconsistencies or  lack of sufficient data invariably has a multi-faceted impact on the time  taken to determine causality, the strength and accuracy of the causality  determined and will ultimately negatively affect the ability of the national  PV team to assist the clinician in the management of the event. The primary  function of the '''Confirm Report Data''' stage is to expedite the process  of assuring data quality and to ensure there is ongoing training and  communication with the facility to improve clinical record keeping.     &lt;br /&gt;
&lt;br /&gt;
A key tool in the  confirmation process is the ability to create data quality tasks for the  associated report. To add a task,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to add a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon[[File:Creating a Task.png|alt=Creating a Task|none|thumb|700x700px|Creating a Task]]&lt;br /&gt;
# Navigate to the corresponding  menu and select that item&lt;br /&gt;
# The system will navigate  you to a form that lists existing tasks that have been allocated to the  report (Please note that if this is the first task for the report you will be  notified of this)[[File:CreateTask02.png.png|alt=CreateTask02.png|none|thumb|684x684px|Create Task 2]]&lt;br /&gt;
# Select the '''Add Task''' button  to add a new task.&lt;br /&gt;
# Enter details of the task noting that the form area is a generic area of the report where the data  quality issue lies, and the type of task can be used to indicate if there is  a data quality issue or a general follow up on the report required. Enter details of the issue or follow up in the details tab.&lt;br /&gt;
# Select the '''Save''' button  to save the task for the adverse event report.[[File:CreateTask03.png.png|alt=CreateTask03.png|none|thumb|450x450px|Save the Task.]]&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using tasks to initiate follow up with the clinician''' &lt;br /&gt;
&lt;br /&gt;
Generating a task will  result in two notifications been sent. The first notification takes the form of an email that is sent to the  reporting clinician containing details of the report and the task that has been created. The second notification takes the form of an internal PViMS  notification that is sent to the system user that registered the report, this  includes a system notification to EDRWeb.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 4: Tracking tasks using its status and adding comments to the  task''' ===&lt;br /&gt;
The key to expediting the data quality assurance process is to improve the process of fixing data  quality issues through improved communication between the facility clinician  and the PV technician. The ability to track task the task becomes critical in this regard.&lt;br /&gt;
&lt;br /&gt;
To change the status of a task:&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task''' for in the '''Confirm Report Data''' table.&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon.&lt;br /&gt;
# Navigate to the corresponding menu and select that item.[[File:Creating a Task.png|alt=Creating a Task.png|none|thumb|700x700px|Tracking a Task]]&lt;br /&gt;
# [[File:Tracking Tasks.png|alt=TrackingTasks02.png|none|thumb|450x450px|Tracking Tasks]]The system will navigate you to a form that lists existing tasks that have been allocated to the report.&lt;br /&gt;
# [[File:ChangeTaskStatus.png.png|alt=ChangeTaskStatus.png|none|thumb|450x450px|Changing Task Status]]Mouse over the menu item at the end of the task and select this icon.&lt;br /&gt;
# Navigate to the  corresponding menu and select that item.&lt;br /&gt;
# [[File:ConfirmTaskChange.png.png|alt=ConfirmTaskChange.png|none|thumb|700x700px|Confirm Task Change]]The system will pop up a  form where the status of a task can be changed.&lt;br /&gt;
# The following task  statuses apply:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Acknowledge Task&lt;br /&gt;
|The clinician can acknowledge that they have    received the task&lt;br /&gt;
|-&lt;br /&gt;
|On Hold&lt;br /&gt;
|The Task has not been cancelled but can be put    on hold&lt;br /&gt;
|-&lt;br /&gt;
|Cancel&lt;br /&gt;
|The task is cancelled and no follow up is    required&lt;br /&gt;
|-&lt;br /&gt;
|Completed&lt;br /&gt;
|The task has been completed and addressed&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using tasks to track efficiency of data  quality processes'''&lt;br /&gt;
&lt;br /&gt;
A task forms a  fundamentally useful mechanism for determining efficacy of data quality processes  centrally and at facility level. Useful metrics such as the number of tasks  per report per facility allow us to determine if a facility needs additional  intervention in the form of training or resources. Other metrics such as time  taken to complete a task may also indicate a new for improved communication  and resourcing.&amp;lt;/blockquote&amp;gt;Comments can be used to  facilitate ongoing communication between the PV technician and the reporting  clinician. To add a comment to a report:&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to add a '''Task''' for in the '''Confirm Report Data''' table.&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon.&lt;br /&gt;
# Navigate to the corresponding menu and select that item.&lt;br /&gt;
# The system will navigate you to a form that lists existing tasks that have been allocated to the report.&lt;br /&gt;
# Mouse over the menu item at the end of the task and select this icon.&lt;br /&gt;
# Navigate to the corresponding menu and select that item.&lt;br /&gt;
# The system will pop up a form where comments can be added to the report.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using comments effectively to communicate  between the PV team and the clinician'''&lt;br /&gt;
&lt;br /&gt;
Comments are useful in  that they facilitate communication between the PV team and the clinician.  While comments should be used judiciously, they indicate there is activity on  the task and forms an effective audit trail for activity on the task for all  to see.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 5: Confirming report is of sufficient quality to proceed''' ===&lt;br /&gt;
A report may only move  into the causality and terminology phase by confirming the report is of  sufficient quality to proceed. It is very important to note that once a  report is confirmed, it is expected that the report is of sufficient quality  to proceed.&lt;br /&gt;
&lt;br /&gt;
Confirmation that a  report has successfully passed the '''Confirm Data''' stage can be achieved  by,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Confirm Report'''&lt;br /&gt;
# The system will pop up a  form asking the user to confirm if the report is ready for confirmation&lt;br /&gt;
# Enter any comments if  necessary and select the '''Save''' button to confirm the report&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Confirm data for a report'''&lt;br /&gt;
&lt;br /&gt;
Confirming the report  will effectively move the report into the Causality and Terminology tab&lt;br /&gt;
&lt;br /&gt;
'''Deleting a report'''&lt;br /&gt;
&lt;br /&gt;
A report should only be deleted  if it is determined to be a duplicate or was incorrectly captured in the  clinical system&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Outcome B: Setting Causality and  Terminology for a Report ==&lt;br /&gt;
Setting causality using  either the MedDRA or Naranjo scale and determining the MedDRA term for the  adverse event&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying adverse event reports that are set for causality  and terminology''' ===&lt;br /&gt;
Reports that have been confirmed  will now appear in the '''Set MedDRA and Causality''' tab. Reports will  remain in this tab until causality and terminology has been completed.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 2: Setting the MedDRA term for a report'''MedDRA is the Medical  Dictionary for Regulatory Activities and is a clinically validated  international medical terminology dictionary-thesaurus used by regulatory  authorities and the biopharmaceutical industry during the regulatory process. ===&lt;br /&gt;
Once a report is moved  into the Set MedDRA and Causality phase, the first step is to set the MedDRA  term for the report. To set the term,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Terminology'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Set Terminology'''&lt;br /&gt;
# The system will pop up a  form where the MedDRA term can be set for the report&lt;br /&gt;
# It is possible to search  for a MedDRA term using 3 different methods.&lt;br /&gt;
#* '''Method 1''' allows for searching for the at the corresponding level you select.  For instance, you can search all Low-Level Terms which include the term you  are searching for. This is the most efficient method for searching for a  term.&lt;br /&gt;
#* '''Method 2''' allows for searching for the term by its associated code. This method  is primarily useful if you know the code you are searching for.&lt;br /&gt;
#* '''Method 3''' allows for searching for the term using the hierarchical structure of  MedDRA. This is the most precise way of searching through MedDRA but is also  the most time consuming.&lt;br /&gt;
# Once you have located the  term you have searched for, select the send icon next to the corresponding  term. This will set the term for the report.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Benefits of allocating a MedDRA term to a  report'''&lt;br /&gt;
&lt;br /&gt;
By allocating a MedDRA  term to the report, this endeavors to facilitate the exchange of clinical  information through a single standardized international medical terminology  that can be used for regulatory communication and evaluation of data  pertaining to medicinal products for human use.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 3: Setting causality per medication''' ===&lt;br /&gt;
Causality assessment essentially means finding a causal association or relationship between a drug  and a drug reaction. It is an evaluation of the likelihood that a particular treatment is the cause of an observed adverse event.&lt;br /&gt;
&lt;br /&gt;
Once a report is moved into the Set MedDRA and Causality phase, after the MedDRA term for the report is set, the second step is to set causality per medication the patient has been exposed to. To set causality using the Naranjo scale,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Causality'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon&lt;br /&gt;
# Navigate to the corresponding menu and select '''Naranjo Causality'''&lt;br /&gt;
# The system will pop up a form where causality can be set per medication&lt;br /&gt;
# To set causality for a specific medication, select the blue send icon for the corresponding  medication, after which you will be navigated to a form where you can set  causality for the medication using the Naranjo scale&lt;br /&gt;
# Answer each question in turn and once all questions are answered, the user will be presented with the  associated causality based on the answers provided&lt;br /&gt;
# Select the '''Save button''' to save causality for the medication&lt;br /&gt;
# You can view causality set per medication using the '''View Button''' &lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Benefits of setting causality per medication'''&lt;br /&gt;
&lt;br /&gt;
Once causality has been set, PViMS is able to detect signals based on patient exposure rates per medication.&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=147</id>
		<title>OpenRIMS-PVM - Causality &amp; Terminology Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=147"/>
		<updated>2023-08-18T15:03:43Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Step 5: Confirming report is of sufficient quality to proceed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Outcome A: Confirming Quality of Report  Data ==&lt;br /&gt;
Determining if the report  has sufficient quality of data to enable setting causality and terminology by  the PV team&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying new adverse event reports that have been submitted  by a facility''' ===&lt;br /&gt;
Reports that have been  submitted within a specified timeframe will be designated as new and appear  in the '''New Report''' tab. Reports will remain in this tab for a period of  2 days, irrespective if any updates have been applied to the report.&lt;br /&gt;
[[File:NewReportTab01.png.png|alt=NewReportTab01.png|frameless|500x500px]][[File:NewReportTab02.png.png|alt=NewReportTab02.png|'''Benefits of the New Reports tab'''This tab is useful to  easily identify reports that have recently been submitted.  It can be used to ensure there is  sufficient resource to respond to each report and to initiate the process of  event management between the PV team and the facility clinician who reported  the event.&lt;br /&gt;
&lt;br /&gt;
'''New Reports time frame'''&lt;br /&gt;
&lt;br /&gt;
It is possible to confirm the period of what constitutes a new report in the administration section of  PViMS. The default setting is 2 days from date of report submission.&lt;br /&gt;
&lt;br /&gt;
|thumb|300x300px|none]]'''Step 2: View clinical details associated to the report'''&lt;br /&gt;
&lt;br /&gt;
Once you have identified  that a new report has been created in PViMS, the process of confirming if the  report is of sufficient quality to allow the setting of causality and  terminology can begin. Clinical details associated to the adverse event can  be viewed using the '''View Details''' or '''Patient Summary''' menu  options that appear alongside the corresponding report.&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to view in the '''Confirm  Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will either display  details associated to the report within PViMS or download a patient summary  MS Word Document&lt;br /&gt;
[[File:PatientSummaryTab01.png.png|alt=PatientSummaryTab01.png|thumb|'''Benefits of the Patient Summary.'''Producing a patient summary provides you with a physical file that can be emailed separately from within the system. This may allow you to share details of the report without designated recipients needing access to PViMS.|none|405x405px]]&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Generating tasks per issue of data quality'''&lt;br /&gt;
&lt;br /&gt;
Data inconsistencies or  lack of sufficient data invariably has a multi-faceted impact on the time  taken to determine causality, the strength and accuracy of the causality  determined and will ultimately negatively affect the ability of the national  PV team to assist the clinician in the management of the event. The primary  function of the '''Confirm Report Data''' stage is to expedite the process  of assuring data quality and to ensure there is ongoing training and  communication with the facility to improve clinical record keeping.     &lt;br /&gt;
&lt;br /&gt;
A key tool in the  confirmation process is the ability to create data quality tasks for the  associated report. To add a task,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to add a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon[[File:Creating a Task.png|alt=Creating a Task|none|thumb|700x700px|Creating a Task]]&lt;br /&gt;
# Navigate to the corresponding  menu and select that item&lt;br /&gt;
# The system will navigate  you to a form that lists existing tasks that have been allocated to the  report (Please note that if this is the first task for the report you will be  notified of this)[[File:CreateTask02.png.png|alt=CreateTask02.png|none|thumb|684x684px|Create Task 2]]&lt;br /&gt;
# Select the '''Add Task''' button  to add a new task.&lt;br /&gt;
# Enter details of the task noting that the form area is a generic area of the report where the data  quality issue lies, and the type of task can be used to indicate if there is  a data quality issue or a general follow up on the report required. Enter details of the issue or follow up in the details tab.&lt;br /&gt;
# Select the '''Save''' button  to save the task for the adverse event report.[[File:CreateTask03.png.png|alt=CreateTask03.png|none|thumb|450x450px|Save the Task.]]&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using tasks to initiate follow up with the clinician''' &lt;br /&gt;
&lt;br /&gt;
Generating a task will  result in two notifications been sent. The first notification takes the form of an email that is sent to the  reporting clinician containing details of the report and the task that has been created. The second notification takes the form of an internal PViMS  notification that is sent to the system user that registered the report, this  includes a system notification to EDRWeb.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 4: Tracking tasks using its status and adding comments to the  task''' ===&lt;br /&gt;
The key to expediting the data quality assurance process is to improve the process of fixing data  quality issues through improved communication between the facility clinician  and the PV technician. The ability to track task the task becomes critical in this regard.&lt;br /&gt;
&lt;br /&gt;
To change the status of a task:&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task''' for in the '''Confirm Report Data''' table.&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon.&lt;br /&gt;
# Navigate to the corresponding menu and select that item.[[File:Creating a Task.png|alt=Creating a Task.png|none|thumb|700x700px|Tracking a Task]]&lt;br /&gt;
# [[File:Tracking Tasks.png|alt=TrackingTasks02.png|none|thumb|450x450px|Tracking Tasks]]The system will navigate you to a form that lists existing tasks that have been allocated to the report.&lt;br /&gt;
# [[File:ChangeTaskStatus.png.png|alt=ChangeTaskStatus.png|none|thumb|450x450px|Changing Task Status]]Mouse over the menu item at the end of the task and select this icon.&lt;br /&gt;
# Navigate to the  corresponding menu and select that item.&lt;br /&gt;
# [[File:ConfirmTaskChange.png.png|alt=ConfirmTaskChange.png|none|thumb|700x700px|Confirm Task Change]]The system will pop up a  form where the status of a task can be changed.&lt;br /&gt;
# The following task  statuses apply:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Acknowledge Task&lt;br /&gt;
|The clinician can acknowledge that they have    received the task&lt;br /&gt;
|-&lt;br /&gt;
|On Hold&lt;br /&gt;
|The Task has not been cancelled but can be put    on hold&lt;br /&gt;
|-&lt;br /&gt;
|Cancel&lt;br /&gt;
|The task is cancelled and no follow up is    required&lt;br /&gt;
|-&lt;br /&gt;
|Completed&lt;br /&gt;
|The task has been completed and addressed&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using tasks to track efficiency of data  quality processes'''&lt;br /&gt;
&lt;br /&gt;
A task forms a  fundamentally useful mechanism for determining efficacy of data quality processes  centrally and at facility level. Useful metrics such as the number of tasks  per report per facility allow us to determine if a facility needs additional  intervention in the form of training or resources. Other metrics such as time  taken to complete a task may also indicate a new for improved communication  and resourcing.&amp;lt;/blockquote&amp;gt;Comments can be used to  facilitate ongoing communication between the PV technician and the reporting  clinician. To add a comment to a report:&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will navigate  you to a form that lists existing tasks that have been allocated to the  report&lt;br /&gt;
# Mouse over the menu item  at the end of the task and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will pop up a  form where comments can be added to the report&lt;br /&gt;
&lt;br /&gt;
'''Using comments effectively to communicate  between the PV team and the clinician'''&lt;br /&gt;
&lt;br /&gt;
Comments are useful in  that they facilitate communication between the PV team and the clinician.  While comments should be used judiciously, they indicate there is activity on  the task and forms an effective audit trail for activity on the task for all  to see.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 5: Confirming report is of sufficient quality to proceed''' ===&lt;br /&gt;
A report may only move  into the causality and terminology phase by confirming the report is of  sufficient quality to proceed. It is very important to note that once a  report is confirmed, it is expected that the report is of sufficient quality  to proceed.&lt;br /&gt;
&lt;br /&gt;
Confirmation that a  report has successfully passed the '''Confirm Data''' stage can be achieved  by,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Confirm Report'''&lt;br /&gt;
# The system will pop up a  form asking the user to confirm if the report is ready for confirmation&lt;br /&gt;
# Enter any comments if  necessary and select the '''Save''' button to confirm the report&lt;br /&gt;
&lt;br /&gt;
'''Confirm data for a report'''&lt;br /&gt;
&lt;br /&gt;
Confirming the report  will effectively move the report into the Causality and Terminology tab&lt;br /&gt;
&lt;br /&gt;
'''Deleting a report'''&lt;br /&gt;
&lt;br /&gt;
A report should only be deleted  if it is determined to be a duplicate or was incorrectly captured in the  clinical system&lt;br /&gt;
&lt;br /&gt;
== Outcome B: Setting Causality and  Terminology for a Report ==&lt;br /&gt;
Setting causality using  either the MedDRA or Naranjo scale and determining the MedDRA term for the  adverse event&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying adverse event reports that are set for causality  and terminology''' ===&lt;br /&gt;
Reports that have been confirmed  will now appear in the '''Set MedDRA and Causality''' tab. Reports will  remain in this tab until causality and terminology has been completed.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 2: Setting the MedDRA term for a report'''MedDRA is the Medical  Dictionary for Regulatory Activities and is a clinically validated  international medical terminology dictionary-thesaurus used by regulatory  authorities and the biopharmaceutical industry during the regulatory process. ===&lt;br /&gt;
Once a report is moved  into the Set MedDRA and Causality phase, the first step is to set the MedDRA  term for the report. To set the term,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Terminology'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Set Terminology'''&lt;br /&gt;
# The system will pop up a  form where the MedDRA term can be set for the report&lt;br /&gt;
# It is possible to search  for a MedDRA term using 3 different methods.&lt;br /&gt;
#* '''Method 1''' allows for searching for the at the corresponding level you select.  For instance, you can search all Low-Level Terms which include the term you  are searching for. This is the most efficient method for searching for a  term.&lt;br /&gt;
#* '''Method 2''' allows for searching for the term by its associated code. This method  is primarily useful if you know the code you are searching for.&lt;br /&gt;
#* '''Method 3''' allows for searching for the term using the hierarchical structure of  MedDRA. This is the most precise way of searching through MedDRA but is also  the most time consuming.&lt;br /&gt;
# Once you have located the  term you have searched for, select the send icon next to the corresponding  term. This will set the term for the report.&lt;br /&gt;
&lt;br /&gt;
'''Benefits of allocating a MedDRA term to a  report'''&lt;br /&gt;
&lt;br /&gt;
By allocating a MedDRA  term to the report, this endeavors to facilitate the exchange of clinical  information through a single standardized international medical terminology  that can be used for regulatory communication and evaluation of data  pertaining to medicinal products for human use.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 3: Setting causality per medication''' ===&lt;br /&gt;
Causality assessment  essentially means finding a causal association or relationship between a drug  and a drug reaction. It is an evaluation of the likelihood that a particular  treatment is the cause of an observed adverse event.&lt;br /&gt;
&lt;br /&gt;
Once a report is moved  into the Set MedDRA and Causality phase, after the MedDRA term for the report  is set, the second step is to set causality per medication the patient has  been exposed to. To set causality using the Naranjo scale,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Causality'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Naranjo Causality'''&lt;br /&gt;
# The system will pop up a  form where causality can be set per medication&lt;br /&gt;
# To set causality for a  specific medication, select the blue send icon for the corresponding  medication, after which you will be navigated to a form where you can set  causality for the medication using the Naranjo scale&lt;br /&gt;
# Answer each question in  turn and once all questions are answered, the user will be presented with the  associated causality based on the answers provided&lt;br /&gt;
# Select the '''Save button'''  to save causality for the medication&lt;br /&gt;
# You can view causality  set per medication using the '''View Button''' &lt;br /&gt;
&lt;br /&gt;
'''Benefits of setting causality per  medication'''&lt;br /&gt;
&lt;br /&gt;
Once causality has been  set, PViMS is able to detect signals based on patient exposure rates per  medication.&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=146</id>
		<title>OpenRIMS-PVM - Causality &amp; Terminology Chapter 1</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=OpenRIMS-PVM_-_Causality_%26_Terminology_Chapter_1&amp;diff=146"/>
		<updated>2023-08-18T15:01:47Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: /* Step 5: Confirming report is of sufficient quality to proceed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Outcome A: Confirming Quality of Report  Data ==&lt;br /&gt;
Determining if the report  has sufficient quality of data to enable setting causality and terminology by  the PV team&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying new adverse event reports that have been submitted  by a facility''' ===&lt;br /&gt;
Reports that have been  submitted within a specified timeframe will be designated as new and appear  in the '''New Report''' tab. Reports will remain in this tab for a period of  2 days, irrespective if any updates have been applied to the report.&lt;br /&gt;
[[File:NewReportTab01.png.png|alt=NewReportTab01.png|frameless|500x500px]][[File:NewReportTab02.png.png|alt=NewReportTab02.png|'''Benefits of the New Reports tab'''This tab is useful to  easily identify reports that have recently been submitted.  It can be used to ensure there is  sufficient resource to respond to each report and to initiate the process of  event management between the PV team and the facility clinician who reported  the event.&lt;br /&gt;
&lt;br /&gt;
'''New Reports time frame'''&lt;br /&gt;
&lt;br /&gt;
It is possible to confirm the period of what constitutes a new report in the administration section of  PViMS. The default setting is 2 days from date of report submission.&lt;br /&gt;
&lt;br /&gt;
|thumb|300x300px|none]]'''Step 2: View clinical details associated to the report'''&lt;br /&gt;
&lt;br /&gt;
Once you have identified  that a new report has been created in PViMS, the process of confirming if the  report is of sufficient quality to allow the setting of causality and  terminology can begin. Clinical details associated to the adverse event can  be viewed using the '''View Details''' or '''Patient Summary''' menu  options that appear alongside the corresponding report.&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to view in the '''Confirm  Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will either display  details associated to the report within PViMS or download a patient summary  MS Word Document&lt;br /&gt;
[[File:PatientSummaryTab01.png.png|alt=PatientSummaryTab01.png|thumb|'''Benefits of the Patient Summary.'''Producing a patient summary provides you with a physical file that can be emailed separately from within the system. This may allow you to share details of the report without designated recipients needing access to PViMS.|none|405x405px]]&lt;br /&gt;
&lt;br /&gt;
'''Step 3: Generating tasks per issue of data quality'''&lt;br /&gt;
&lt;br /&gt;
Data inconsistencies or  lack of sufficient data invariably has a multi-faceted impact on the time  taken to determine causality, the strength and accuracy of the causality  determined and will ultimately negatively affect the ability of the national  PV team to assist the clinician in the management of the event. The primary  function of the '''Confirm Report Data''' stage is to expedite the process  of assuring data quality and to ensure there is ongoing training and  communication with the facility to improve clinical record keeping.     &lt;br /&gt;
&lt;br /&gt;
A key tool in the  confirmation process is the ability to create data quality tasks for the  associated report. To add a task,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to add a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon[[File:Creating a Task.png|alt=Creating a Task|none|thumb|700x700px|Creating a Task]]&lt;br /&gt;
# Navigate to the corresponding  menu and select that item&lt;br /&gt;
# The system will navigate  you to a form that lists existing tasks that have been allocated to the  report (Please note that if this is the first task for the report you will be  notified of this)[[File:CreateTask02.png.png|alt=CreateTask02.png|none|thumb|684x684px|Create Task 2]]&lt;br /&gt;
# Select the '''Add Task''' button  to add a new task.&lt;br /&gt;
# Enter details of the task noting that the form area is a generic area of the report where the data  quality issue lies, and the type of task can be used to indicate if there is  a data quality issue or a general follow up on the report required. Enter details of the issue or follow up in the details tab.&lt;br /&gt;
# Select the '''Save''' button  to save the task for the adverse event report.[[File:CreateTask03.png.png|alt=CreateTask03.png|none|thumb|450x450px|Save the Task.]]&lt;br /&gt;
&amp;lt;blockquote&amp;gt;'''Using tasks to initiate follow up with the clinician''' &lt;br /&gt;
&lt;br /&gt;
Generating a task will  result in two notifications been sent. The first notification takes the form of an email that is sent to the  reporting clinician containing details of the report and the task that has been created. The second notification takes the form of an internal PViMS  notification that is sent to the system user that registered the report, this  includes a system notification to EDRWeb.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== '''Step 4: Tracking tasks using its status and adding comments to the  task''' ===&lt;br /&gt;
The key to expediting the data quality assurance process is to improve the process of fixing data  quality issues through improved communication between the facility clinician  and the PV technician. The ability to track task the task becomes critical in this regard.&lt;br /&gt;
&lt;br /&gt;
To change the status of a task:&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task''' for in the '''Confirm Report Data''' table.&lt;br /&gt;
# Mouse over the menu item at the end of the report and select this icon.&lt;br /&gt;
# Navigate to the corresponding menu and select that item.[[File:Creating a Task.png|alt=Creating a Task.png|none|thumb|700x700px|Tracking a Task]]&lt;br /&gt;
# [[File:Tracking Tasks.png|alt=TrackingTasks02.png|none|thumb|450x450px|Tracking Tasks]]The system will navigate you to a form that lists existing tasks that have been allocated to the report.&lt;br /&gt;
# [[File:ChangeTaskStatus.png.png|alt=ChangeTaskStatus.png|none|thumb|450x450px|Changing Task Status]]Mouse over the menu item at the end of the task and select this icon.&lt;br /&gt;
# Navigate to the  corresponding menu and select that item.&lt;br /&gt;
# [[File:ConfirmTaskChange.png.png|alt=ConfirmTaskChange.png|none|thumb|700x700px|Confirm Task Change]]The system will pop up a  form where the status of a task can be changed.&lt;br /&gt;
# The following task  statuses apply:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Acknowledge Task&lt;br /&gt;
|The clinician can acknowledge that they have    received the task&lt;br /&gt;
|-&lt;br /&gt;
|On Hold&lt;br /&gt;
|The Task has not been cancelled but can be put    on hold&lt;br /&gt;
|-&lt;br /&gt;
|Cancel&lt;br /&gt;
|The task is cancelled and no follow up is    required&lt;br /&gt;
|-&lt;br /&gt;
|Completed&lt;br /&gt;
|The task has been completed and addressed&lt;br /&gt;
|}&lt;br /&gt;
'''Using tasks to track efficiency of data  quality processes'''&lt;br /&gt;
&lt;br /&gt;
A task forms a  fundamentally useful mechanism for determining efficacy of data quality processes  centrally and at facility level. Useful metrics such as the number of tasks  per report per facility allow us to determine if a facility needs additional  intervention in the form of training or resources. Other metrics such as time  taken to complete a task may also indicate a new for improved communication  and resourcing.Comments can be used to  facilitate ongoing communication between the PV technician and the reporting  clinician. To add a comment to a report,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will navigate  you to a form that lists existing tasks that have been allocated to the  report&lt;br /&gt;
# Mouse over the menu item  at the end of the task and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select that item&lt;br /&gt;
# The system will pop up a  form where comments can be added to the report&lt;br /&gt;
&lt;br /&gt;
'''Using comments effectively to communicate  between the PV team and the clinician'''&lt;br /&gt;
&lt;br /&gt;
Comments are useful in  that they facilitate communication between the PV team and the clinician.  While comments should be used judiciously, they indicate there is activity on  the task and forms an effective audit trail for activity on the task for all  to see.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 5: Confirming report is of sufficient quality to proceed''' ===&lt;br /&gt;
A report may only move  into the causality and terminology phase by confirming the report is of  sufficient quality to proceed. It is very important to note that once a  report is confirmed, it is expected that the report is of sufficient quality  to proceed.&lt;br /&gt;
&lt;br /&gt;
Confirmation that a  report has successfully passed the '''Confirm Data''' stage can be achieved  by,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to ass a '''Task'''  for in the '''Confirm Report Data''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Confirm Report'''&lt;br /&gt;
# The system will pop up a  form asking the user to confirm if the report is ready for confirmation&lt;br /&gt;
# Enter any comments if  necessary and select the '''Save''' button to confirm the report&lt;br /&gt;
&lt;br /&gt;
'''Confirm data for a report'''&lt;br /&gt;
&lt;br /&gt;
Confirming the report  will effectively move the report into the Causality and Terminology tab&lt;br /&gt;
&lt;br /&gt;
'''Deleting a report'''&lt;br /&gt;
&lt;br /&gt;
A report should only be deleted  if it is determined to be a duplicate or was incorrectly captured in the  clinical system&lt;br /&gt;
&lt;br /&gt;
== Outcome B: Setting Causality and  Terminology for a Report ==&lt;br /&gt;
Setting causality using  either the MedDRA or Naranjo scale and determining the MedDRA term for the  adverse event&lt;br /&gt;
&lt;br /&gt;
=== '''Step 1: Identifying adverse event reports that are set for causality  and terminology''' ===&lt;br /&gt;
Reports that have been confirmed  will now appear in the '''Set MedDRA and Causality''' tab. Reports will  remain in this tab until causality and terminology has been completed.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 2: Setting the MedDRA term for a report'''MedDRA is the Medical  Dictionary for Regulatory Activities and is a clinically validated  international medical terminology dictionary-thesaurus used by regulatory  authorities and the biopharmaceutical industry during the regulatory process. ===&lt;br /&gt;
Once a report is moved  into the Set MedDRA and Causality phase, the first step is to set the MedDRA  term for the report. To set the term,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Terminology'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Set Terminology'''&lt;br /&gt;
# The system will pop up a  form where the MedDRA term can be set for the report&lt;br /&gt;
# It is possible to search  for a MedDRA term using 3 different methods.&lt;br /&gt;
#* '''Method 1''' allows for searching for the at the corresponding level you select.  For instance, you can search all Low-Level Terms which include the term you  are searching for. This is the most efficient method for searching for a  term.&lt;br /&gt;
#* '''Method 2''' allows for searching for the term by its associated code. This method  is primarily useful if you know the code you are searching for.&lt;br /&gt;
#* '''Method 3''' allows for searching for the term using the hierarchical structure of  MedDRA. This is the most precise way of searching through MedDRA but is also  the most time consuming.&lt;br /&gt;
# Once you have located the  term you have searched for, select the send icon next to the corresponding  term. This will set the term for the report.&lt;br /&gt;
&lt;br /&gt;
'''Benefits of allocating a MedDRA term to a  report'''&lt;br /&gt;
&lt;br /&gt;
By allocating a MedDRA  term to the report, this endeavors to facilitate the exchange of clinical  information through a single standardized international medical terminology  that can be used for regulatory communication and evaluation of data  pertaining to medicinal products for human use.&lt;br /&gt;
&lt;br /&gt;
=== '''Step 3: Setting causality per medication''' ===&lt;br /&gt;
Causality assessment  essentially means finding a causal association or relationship between a drug  and a drug reaction. It is an evaluation of the likelihood that a particular  treatment is the cause of an observed adverse event.&lt;br /&gt;
&lt;br /&gt;
Once a report is moved  into the Set MedDRA and Causality phase, after the MedDRA term for the report  is set, the second step is to set causality per medication the patient has  been exposed to. To set causality using the Naranjo scale,&lt;br /&gt;
&lt;br /&gt;
# Locate the report you would like to '''Set''' '''Causality'''  for in the '''Set MedDRA and Causality''' table&lt;br /&gt;
# Mouse over the menu item  at the end of the report and select this icon&lt;br /&gt;
# Navigate to the  corresponding menu and select '''Naranjo Causality'''&lt;br /&gt;
# The system will pop up a  form where causality can be set per medication&lt;br /&gt;
# To set causality for a  specific medication, select the blue send icon for the corresponding  medication, after which you will be navigated to a form where you can set  causality for the medication using the Naranjo scale&lt;br /&gt;
# Answer each question in  turn and once all questions are answered, the user will be presented with the  associated causality based on the answers provided&lt;br /&gt;
# Select the '''Save button'''  to save causality for the medication&lt;br /&gt;
# You can view causality  set per medication using the '''View Button''' &lt;br /&gt;
&lt;br /&gt;
'''Benefits of setting causality per  medication'''&lt;br /&gt;
&lt;br /&gt;
Once causality has been  set, PViMS is able to detect signals based on patient exposure rates per  medication.&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
	<entry>
		<id>http://129.151.190.5/index.php?title=File:ConfirmTaskChange.png.png&amp;diff=145</id>
		<title>File:ConfirmTaskChange.png.png</title>
		<link rel="alternate" type="text/html" href="http://129.151.190.5/index.php?title=File:ConfirmTaskChange.png.png&amp;diff=145"/>
		<updated>2023-08-18T15:00:24Z</updated>

		<summary type="html">&lt;p&gt;Khoppenworth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ConfirmTaskChange.png&lt;/div&gt;</summary>
		<author><name>Khoppenworth</name></author>
	</entry>
</feed>