SOAP form not displaying properly

rdh61 wrote on Wednesday, March 30, 2016:

Hi,

I have modified my SOAP form. I am copying below the code in my modified file /soap/templates/general_new.html.

As things stand with this code, OpenEMR displays the ‘Exercise prescription’ field, but does not display the ‘Advice’ and ‘Plan’ fields (the two last fields).

However, if I remove the code for the ‘Exercise prescription’ field, ‘Advice’ and ‘Plan’ are displayed normally. I find that odd. What can I do to resolve this so that all three of these fields are displayed?

Thank you.

<html>
<head>
{php}html_header_show();{/php}
{literal}

 <style type="text/css" title="mystyles" media="all">
<!--
td {
	font-size:12pt;
	font-family:helvetica;
}
li{
	font-size:11pt;
	font-family:helvetica;
	margin-left: 15px;
}
a {
	font-size:11pt;
	font-family:helvetica;
}
.title {
	font-family: sans-serif;
	font-size: 12pt;
	font-weight: bold;
	text-decoration: none;
	color: #000000;
}

.form_text{
	font-family: sans-serif;
	font-size: 9pt;
	text-decoration: none;
	color: #000000;
}

-->
</style>
{/literal}
</head>
<body bgcolor="{$STYLE.BGCOLOR2}">
<p><span class="title">{php} xl('SOAP','e'); {/php}</span></p>
<form name="soap" method="post" action="{$FORM_ACTION}/interface/forms/soap/save.php"
 onsubmit="return top.restoreSession()">
<table>
	<tr>
		<td align="left">{php} xl('Subjective','e'); {/php}</td>
		<td width="90%">
			<textarea name="subjective" cols="60" rows="6">{$data->get_subjective()}</textarea>
		</td>
	</tr>
	<tr>
		<td align="left">{php} xl('Objective','e'); {/php}</td>
		<td width="90%">
			<textarea name="objective" cols="60" rows="6">{$data->get_objective()}</textarea>
		</td>
	</tr>
	<tr>
		<td align="left">{php} xl('Assessment','e'); {/php}</td>
		<td width="90%">
			<textarea name="assessment" cols="60" rows="6">{$data->get_assessment()}</textarea>
		</td>
	</tr>
        <tr>
		<td align="left">{php} xl('Treatment','e'); {/php}</td>
		<td width="90%">
			<textarea name="treatment" cols="60" rows="6">{$data->get_treatment()}</textarea>
		</td>
	</tr>
        <tr>
		<td align="left">{php} xl('Exercise prescription','e'); {/php}</td>
		<td width="90%">
			<textarea name="exercise_ps" cols="60" rows="6">{$data->get_exercise_ps()}</textarea>
		</td>
	</tr>      
        <tr>
		<td align="left">{php} xl('Advice','e'); {/php}</td>
		<td width="90%">
			<textarea name="advice" cols="60" rows="6">{$data->get_advice()}</textarea>
		</td>
	</tr>
	<tr>
		<td align="left">{php} xl('Plan','e'); {/php}</td>
		<td width="90%">
			<textarea name="plan" cols="60" rows="6">{$data->get_plan()}</textarea>
		</td>
	</tr>
	<tr>
		<td><input type="submit" name="Submit" value={php} xl('Save Form','e','"','"'); {/php}</td>
    <td><a href="{$DONT_SAVE_LINK}" class="link" onclick="top.restoreSession()">[{php} xl("Don't Save","e"); {/php}]</a></td>
	</tr>
</table>
<input type="hidden" name="id" value="{$data->get_id()}" />
<input type="hidden" name="activity" value="{$data->get_activity()}">
<input type="hidden" name="pid" value="{$data->get_pid()}">
<input type="hidden" name="process" value="true">
</form>
</body>
</html>

rdh61 wrote on Wednesday, March 30, 2016:

Also, the “Submit” and “Don’t save” buttons are missing when ‘Exercise prescription’ is added.

epsdky wrote on Thursday, March 31, 2016:

Hello Robert,

Does this exist…

$data->get_exercise_ps()

(…_ps()?)

Regards,

epsdky.

rdh61 wrote on Thursday, March 31, 2016:

Thanks for your reply. The following exists in the general_new.html file (see code provided above). Is that what you meant?

$data->get_exercise_ps()

epsdky wrote on Thursday, March 31, 2016:

No. If $data->get_exercise_ps() is not referencing an existing function then this could be the cause of the page ending at this point. I tested this idea out by altering the name of a similar part of the code
($data->get_objective() changed to $data->get_objectivex()) and this caused the problem you describe, page stops after objective field.

If $data->get_exercise_ps() does not exist (the reference in general_new.htm is not the function) then you will need to define it.

rdh61 wrote on Friday, April 01, 2016:

How do I do this?

I must have done it before because I had already successfully added fields to the form, but I have no recollection of this step.

epsdky wrote on Friday, April 01, 2016:

Since “Advice” worked it’s likely you already did.

The above code has no issues (I have created the form with this code (filling in the required code additions in FormSOAP.class.php). So problem is elswhere. If you send me your modified files I will take a look.

rdh61 wrote on Friday, April 01, 2016:

That’s very kind of you. I’ll have to get back to this in a couple of weeks. I’ll PM you to explain.

rdh61 wrote on Tuesday, April 19, 2016:

@ epsdky

I am attaching here my files. Thanks.

epsdky wrote on Wednesday, April 20, 2016:

Hello Robert,

In FormSOAP.class.php the following code needs to be added to fix the problem you describe above

 	function get_exercise_ps() {
		return $this->exercise_ps;
	}
	function set_exercise_ps($data) {
		if(!empty($data)){
			$this->exercise_ps = $data;
    }

Regards,

epsdky.

epsdky wrote on Thursday, April 21, 2016:

Please note that for report.php line 3 and line 19 changed with 4.1.1 and in table.sql line 17 (line 14 in original file) changed with 4.2.1.

rdh61 wrote on Friday, April 22, 2016:

OK, thanks. The form is now working correctly.