Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ include file="/WEB-INF/template/include.jsp"%>
- <%@ include file="/WEB-INF/template/header.jsp"%>
- <%@ include file="template/localHeader.jsp"%>
- <openmrs:htmlInclude file="<openmrs:contextPath/>/dwr/interface/DWRMyModuleService.js"/>
- <script type="text/javascript">
- $j(document).ready(function(){
- $j('#vitalSigns').data("counter",0);
- $j('#socialHistory').data("counter",0);
- $j('#post').click(function(){
- $j('#vitalSignsCounter').val($j('#vitalSigns').data("counter"));
- $j('#socialHistoryCounter').val($j('#socialHistory').data("counter"));
- $j('form').submit();
- });
- $j(':button.addButton').click(function(){
- var parent=$j(this).parent();
- var count=$j(parent).data("counter");
- var parentId=$j(parent).attr('id');
- var generatedId=parentId+count+"";
- alert($j('#'+parentId+'_conceptId_selection').val());
- DWRMyModuleService.getConceptMappings($j('#'+parentId+'_conceptId').val(),getConceptReferenceTerms);
- $j(parent).data("counter",count+1);
- var spanId=generatedId+"_span";
- var v='</br><span id="'+spanId+'">'+$j('#'+parentId+'_conceptId_selection').val()+'<input type="hidden" id="'+spanId+'_hid" name="'+spanId+'_hid" value="'+$j('#'+parentId+'_conceptId').val()+'"/><input id="'+spanId+'_remove" type="button" value="remove" onClick="$j(this).parent().remove();refresh(\''+parentId+'\')"/></span>';
- $j(parent).append(v);
- });
- });
- function getConceptReferenceTerms(map)
- {
- alert("The no of reference source to this concept is"+map.length);
- }
- function refresh (superParentId) {
- var flag=true;
- $j('#'+superParentId+' span').each(function(index) {
- $j('#'+superParentId).data("counter",index+1);
- flag=false;
- var spanId=this.id;
- var newSpanId=superParentId+index+"_span";
- this.id=newSpanId;
- $j('#'+spanId+'_hid').attr('name',newSpanId+'_hid').attr('id',newSpanId+'_hid');
- $j('#'+spanId+'_remove').removeAttr('onclick',null).unbind('click').attr('id',newSpanId+'_remove').click(function() {
- $j('#'+newSpanId).remove();
- refresh(superParentId);
- });
- });
- if(flag)
- $j('#'+superParentId).data("counter",0);
- }
- </script>
- <form id='ccdSections' method="POST">
- <div class="boxHeader"><spring:message code="ExportCCD.configure.vital.signs"/></div>
- <div id="vitalSigns" class="box">
- <spring:message code="Concept.find"/><openmrs_tag:conceptField formFieldName="vitalSigns_conceptId" formFieldId="vitalSigns_conceptId" />
- <input type="button" value="ADD" id="addButton" class="addButton"/>
- <input type="hidden" id="vitalSignsCounter" name="vitalSignsCounter"/>
- </div>
- <br>
- <div class="boxHeader"><spring:message code="ExportCCD.configure.social.history"/></div>
- <div id="socialHistory" class="box">
- <spring:message code="Concept.find"/><openmrs_tag:conceptField formFieldName="socialHistory_conceptId" formFieldId="socialHistory_conceptId" />
- <input type="button" value="ADD" id="addButton" class="addButton"/>
- <input type="hidden" id="socialHistoryCounter" name="socialHistoryCounter"/>
- </div>
- <input type="submit" value='<spring:message code="general.save" />' /></td>
- </form>
- <%@ include file="/WEB-INF/template/footer.jsp"%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement