Pulmocare (RM Form)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m42s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m42s
Details
This commit is contained in:
parent
120a645058
commit
a5c35bf641
|
|
@ -114,7 +114,7 @@ if (!empty($submissions->data->submissions)) {
|
||||||
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
||||||
@break
|
@break
|
||||||
@case('dropdown')
|
@case('dropdown')
|
||||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }} data-selected="{{ isset($question->value) ? $question->value : '' }}">
|
||||||
<option value=""> -- Select -- </option>
|
<option value=""> -- Select -- </option>
|
||||||
@foreach ($question->options as $option)
|
@foreach ($question->options as $option)
|
||||||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
||||||
|
|
@ -276,7 +276,17 @@ if (!empty($submissions->data->submissions)) {
|
||||||
// All contacts loaded for each hierarchy
|
// All contacts loaded for each hierarchy
|
||||||
// Example usage: console.log(contacts);
|
// Example usage: console.log(contacts);
|
||||||
// Filter out contacts where value == 'sample'
|
// Filter out contacts where value == 'sample'
|
||||||
contacts = contacts.filter(function(itm) { return itm.value !== 'sample'; });
|
contacts = contacts.filter(function(itm) { return itm.value !== 'sample' && itm.contact && itm.contact.speciality; });
|
||||||
|
contacts.sort((a, b) =>
|
||||||
|
a.display.localeCompare(b.display, undefined, { sensitivity: 'base' })
|
||||||
|
);
|
||||||
|
|
||||||
|
// Remove duplicate by Doctor Name
|
||||||
|
contacts = Array.from(
|
||||||
|
new Map(
|
||||||
|
contacts.map(item => [item.display.trim().toLowerCase(), item])
|
||||||
|
).values()
|
||||||
|
);
|
||||||
console.log(contacts);
|
console.log(contacts);
|
||||||
|
|
||||||
// Loop through contacts and append options to select elements whose id starts with 'field-contact_id'
|
// Loop through contacts and append options to select elements whose id starts with 'field-contact_id'
|
||||||
|
|
@ -294,6 +304,8 @@ if (!empty($submissions->data->submissions)) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("[id^='field-contact_id']").trigger('change');
|
||||||
|
|
||||||
function enforceUniqueDoctorSelections() {
|
function enforceUniqueDoctorSelections() {
|
||||||
var selectedValues = [];
|
var selectedValues = [];
|
||||||
|
|
||||||
|
|
@ -351,6 +363,11 @@ if (!empty($submissions->data->submissions)) {
|
||||||
select.append(option);
|
select.append(option);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var selectedValue = select.data('selected');
|
||||||
|
if (selectedValue) {
|
||||||
|
select.val(selectedValue);
|
||||||
|
}
|
||||||
|
|
||||||
// For each select element, add a change event handler to populate `msl_code` and `speciality`
|
// For each select element, add a change event handler to populate `msl_code` and `speciality`
|
||||||
// We assume dropdowns and targets follow the pattern:
|
// We assume dropdowns and targets follow the pattern:
|
||||||
// - select: field-contact_id_1, field-contact_id_2, ..., field-contact_id
|
// - select: field-contact_id_1, field-contact_id_2, ..., field-contact_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue