package com.jasamedika.medifirst2000.controller; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.jasamedika.medifirst2000.dao.BridgingDao; import com.jasamedika.medifirst2000.vo.custom.BridgeBUKBorVO; import com.jasamedika.medifirst2000.vo.custom.BridgeKunjunganPasienVO; @RestController @RequestMapping("/sirsbuk") public class BridgingSirsBukController { @Autowired private BridgingDao myDao; @RequestMapping(value = "/irj", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE }) public ArrayList kunjunganIrj(@RequestParam(value = "tanggal", required = true) String tanggal) throws ParseException { ArrayList output = new ArrayList(); List returnVal = null; String tanggalan[] = tanggal.split("-"); if(tanggalan.length==3){ boolean valid = false; if(tanggalan[0].length()==1){ tanggalan[0]="0"+tanggalan[0]; } if(tanggalan[1].length()==1){ tanggalan[1]="0"+tanggalan[1]; } if(tanggalan[2].length()==2){ tanggalan[2]="20"+tanggalan[2]; } if((tanggalan[0].length()==2)&(tanggalan[1].length()==2)&(tanggalan[2].length()==4)){ valid=true; }else{ System.out.println("tanggalan salah:"+ tanggalan[0]+"-"+tanggalan[1] +"-"+tanggalan[2]); } if(valid){ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); Date d = (Date) sdf.parse(tanggalan[0]+"/"+tanggalan[1]+"/"+tanggalan[2]); returnVal = myDao.kunjunganIrj(d); String namaRuang = null; for(int j = 0; j0){ namaRuang = (String)returnVal.get(j)[2]; System.out.println(namaRuang); for(int k =0; k kunjunganIri(@RequestParam(value = "tanggal", required = true) String tanggal) throws ParseException { ArrayList output = new ArrayList(); List returnVal = null; String tanggalan[] = tanggal.split("-"); if(tanggalan.length==3){ boolean valid = false; if(tanggalan[0].length()==1){ tanggalan[0]="0"+tanggalan[0]; } if(tanggalan[1].length()==1){ tanggalan[1]="0"+tanggalan[1]; } if(tanggalan[2].length()==2){ tanggalan[2]="20"+tanggalan[2]; } if((tanggalan[0].length()==2)&(tanggalan[1].length()==2)&(tanggalan[2].length()==4)){ valid=true; }else{ System.out.println("tanggalan salah:"+ tanggalan[0]+"-"+tanggalan[1] +"-"+tanggalan[2]); } if(valid){ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); Date d = (Date) sdf.parse(tanggalan[0]+"/"+tanggalan[1]+"/"+tanggalan[2]); returnVal = myDao.kunjunganIri(d); String namaRuang = null; for(int j = 0; j0){ namaRuang = (String)returnVal.get(j)[2]; System.out.println(namaRuang); for(int k =0; k kunjunganIgd(@RequestParam(value = "tanggal", required = true) String tanggal) throws ParseException { ArrayList output = new ArrayList(); List returnVal = null; String tanggalan[] = tanggal.split("-"); if(tanggalan.length==3){ boolean valid = false; if(tanggalan[0].length()==1){ tanggalan[0]="0"+tanggalan[0]; } if(tanggalan[1].length()==1){ tanggalan[1]="0"+tanggalan[1]; } if(tanggalan[2].length()==2){ tanggalan[2]="20"+tanggalan[2]; } if((tanggalan[0].length()==2)&(tanggalan[1].length()==2)&(tanggalan[2].length()==4)){ valid=true; }else{ System.out.println("tanggalan salah:"+ tanggalan[0]+"-"+tanggalan[1] +"-"+tanggalan[2]); } if(valid){ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); Date d = (Date) sdf.parse(tanggalan[0]+"/"+tanggalan[1]+"/"+tanggalan[2]); returnVal = myDao.kunjunganIgd(d); String namaRuang = null; for(int j = 0; j0){ namaRuang = (String)returnVal.get(j)[2]; System.out.println(namaRuang); for(int k =0; k bed = myDao.getQtyBed(); Integer totalBed =0; ArrayList ruanganId= new ArrayList(); for(int i = 0; i x = myDao.getListPasienRanap(d1,d2); System.out.println( "Jumlah Pasien total" + String.valueOf(x.size()) ); int cnt[] = new int[daysInMonth]; for(int i = 0;i=Integer.valueOf(tgl1s[0])+1)&(j<=Integer.valueOf(tgl2s[0])+1)){ cnt[j]++; } } } int totalCnt = 0; for(int i=0;i ret = myDao.getQtyBed(); Integer total =0; ArrayList ruanganId= new ArrayList(); for(int i = 0; i