NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

goruntuleyici fayda


package tr.com.rest;

import android.util.Log;

import tr.com.fayda.YerelBellekFayda;

/**
* Created by asettar on 12/26/16.
*/

public class GoruntuleyiciFayda {


private static String GORUNTULEYICI_URL;
private static String goruntuleyiciUrlTag = "goruntuleyiciUrlTag";
private static String HARICIGORUNTULEYİCİ_URL;
private static String hariciUrlTag="hariciPacsURlTag";
public static String getGoruntuleyiciUrl() {
if (GORUNTULEYICI_URL == null) {
GORUNTULEYICI_URL = YerelBellekFayda.getString(goruntuleyiciUrlTag);
if (GORUNTULEYICI_URL == null) {
Log.d("PACS_URL", "PACS_URL alınmamış");
}
}
return GORUNTULEYICI_URL;
}

public static void setGoruntuleyiciUrl(String goruntuleyiciUrl) {
GORUNTULEYICI_URL = "http://192.168.1.100:8080/pacsweb/";
if(!GORUNTULEYICI_URL.endsWith("/")){
GORUNTULEYICI_URL += "/";
}
YerelBellekFayda.kaydet(goruntuleyiciUrlTag, GORUNTULEYICI_URL);
}

public static String getHaricigoruntuleyiciUrl() {
if (HARICIGORUNTULEYİCİ_URL == null) {
HARICIGORUNTULEYİCİ_URL=YerelBellekFayda.getString(hariciUrlTag);
if (HARICIGORUNTULEYİCİ_URL==null){
Log.d("Harici_Pacs_Url","harici pacs url alınamamış");
}
}
return HARICIGORUNTULEYİCİ_URL;
}

public static void setHaricigoruntuleyiciUrl(String haricigoruntuleyiciUrl) {
HARICIGORUNTULEYİCİ_URL = haricigoruntuleyiciUrl;
YerelBellekFayda.kaydet(hariciUrlTag, HARICIGORUNTULEYİCİ_URL);
}
}

//////////////////////Anamnez ıtem




package tr.com.his.mergen.poliklinik.hastaislemleri.form.anamnez;

import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.util.Date;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

import butterknife.BindView;
import butterknife.ButterKnife;
import tr.com.connection.retrofit.RetrofitCallback;
import tr.com.fayda.EkranFayda;
import tr.com.fayda.ImajFayda;
import tr.com.fayda.JacksonFactory;
import tr.com.fayda.ResourceFayda;
import tr.com.his.mergen.R;
import tr.com.his.mergen.girisislemleri.OturumFayda;
import tr.com.his.mergen.poliklinik.PacsBildirimCalismaListActivity;
import tr.com.his.mergen.retrofit.adapter.AnamnezService;
import tr.com.mergen.extgoruntuleyici.rest.StudyServis;
import tr.com.mergentech.mergentechsbs.varlik.model.his.HstBasvuru;
import tr.com.mergentech.mergentechsbs.varlik.model.his.HstMuayene;
import tr.com.mergentech.mergentechsbs.varlik.model.his.HstMuayeneDetay;
import tr.com.model.Study;
import tr.com.view.ExtActivity;

/**
* Created by asettar on 01.08.2016.
*/
public class AnamnezItem {

@BindView(R.id.rLayoutAnamnezItem)
RelativeLayout anamnezItemView;

@BindView(R.id.tvMuayeneAlanAdi)
TextView tvMuayeneAlanAdi;

@BindView(R.id.etMuayeneAlan)
EditText etMuayeneAlan;

@BindView(R.id.tvMuayeneAlanDetay)
TextView tvMuayeneAlanDetay;

@BindView(R.id.progressbar)
ProgressBar progressbar;

@BindView(R.id.ivKayitDurum)
ImageView ivKayitDurum;


private HstMuayeneDetay hstMuayeneDetay;

private AnamnezService anamnezService = new AnamnezService();

private Drawable drawable = ResourceFayda.getDrawable(R.drawable.svg_tick);


private boolean isKaydedildi = true;
private HstMuayene hstMuayene;
private HstBasvuru hstBasvuru;
private String seciliGruplar;

private Timer timer;


public AnamnezItem(HstMuayeneDetay hstMuayeneDetay, HstMuayene hstMuayene, HstBasvuru hstBasvuru, String seciliGruplar) {
setSeciliGruplar(seciliGruplar);
setHstBasvuru(hstBasvuru);
setHstMuayene(hstMuayene);
setHstMuayeneDetay(hstMuayeneDetay);
View view = EkranFayda.layoutInflater().inflate(R.layout.anamnez_item, null, false);
ButterKnife.bind(this, view);

progressbar.getIndeterminateDrawable().setColorFilter(0xFFFFFFFF, android.graphics.PorterDuff.Mode.MULTIPLY);

ivKayitDurum.setImageDrawable(drawable);
if (hstMuayeneDetay != null && hstMuayeneDetay.getHstMuayeneAlan() != null) {
tvMuayeneAlanAdi.setText(hstMuayeneDetay.getHstMuayeneAlan().getTAdi());
}


if (hstMuayeneDetay.getTGizleyenuser() != null && !hstMuayeneDetay.getTGizleyenuser().equals(OturumFayda.getKullaniciKodu())) {
etMuayeneAlan.setEnabled(false);
etMuayeneAlan.setBackgroundColor(ResourceFayda.getColor(R.color.anamnez_gizlenmis_alan));
} else {
etMuayeneAlan.setEnabled(true);
}
if (hstMuayeneDetay.getTText() != null) {

etMuayeneAlan.setText(hstMuayeneDetay.getTText());
}
etMuayeneAlan.setSelection(etMuayeneAlan.getText().length());

etMuayeneAlan.setMinLines(5);
etMuayeneAlan.setMaxLines(5);

tvMuayeneAlanDetay.setText(hstMuayeneDetay.getTCevap());

etMuayeneAlan.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
if (!hasFocus) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
kaydet(false);
}
}, 100);
}
}
});

etMuayeneAlan.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

}

@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (timer != null) {
timer.cancel();
}
}

@Override
public void afterTextChanged(Editable editable) {
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
kaydet(false);
}
}, 2000);
setKaydedildi(false);
}
});
ivKayitDurum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
kaydet(true);
}
});


}
private String checktext(String s) {//FIXME
String dogru="";
for (int i = 0; i < s.length(); i++) {
switch (s.charAt(i)) {
case 'ğ':
dogru += 'g';
break;
case 'ı':
dogru += 'i';
break;
case 'I':
dogru += 'i';
break;
case 'İ':
dogru += 'i';
break;
case 'Ç':
dogru += 'c';
break;
case 'ş':
dogru += 's';
break;
case 'ü':
dogru += 'u';
break;
case 'ö':
dogru += 'o';
break;
case 'ç':
dogru += 'c';
break;
default:
dogru += s.charAt(i);
dogru.toLowerCase();
}
}
return dogru;
}
private void kaydet(boolean force) {
if (isAlanGuncellendi() || force) {
ExtActivity.currentActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
progressbar.setVisibility(View.VISIBLE);
ivKayitDurum.setVisibility(View.GONE);
}
});

//getHstMuayeneDetay().setTText(new String(getYazilanMetin().trim().getBytes("ISO-8859-1"),"UTF-8"));//FIXME
getHstMuayeneDetay().setTText(getYazilanMetin());//FIXME
setKaydedildi(false);


hstMuayene.setTAlanGrupId(getSeciliGruplar());
//anamnez ekleme sorunu için bu değişikliği yaptık gürsu da hata vardı
if (hstMuayene.getId()!=null){

if (hstMuayene.getId().getTBasvuruno() == null) {
hstMuayene.getId().setTBasvuruno(this.getHstBasvuru());
}
if (hstMuayene.getId().getTSira() == null) {
hstMuayene.getId().setTSira(1);
}

if (hstMuayene.getTBasSaati() == null) {
hstMuayene.setTBasSaati(new Date());
}

hstMuayene.setTBitSaati(new Date());
hstMuayene.setTBolumtipi(hstBasvuru.getTPoliklinik());
hstMuayene.setTBolumKodu(hstBasvuru.getTBolumkodu());
hstMuayene.setTYazanKisi(OturumFayda.getKullaniciKodu());
//varlık güncellendiğinde bu id boş gidiyordu bu şekilde set ettik

if (hstMuayene.getId().getTIslemHareketId() != null) {
getHstMuayeneDetay().getId().setTIslemHareketId(hstMuayene.getId().getTIslemHareketId().getId());
}

}
new Thread(new Runnable() {
@Override
public void run() {
anamnezService.muayeneAlanKaydet(getHstMuayeneDetay(), hstMuayene, new RetrofitCallback<HstMuayeneDetay>() {
@Override
public void load(HstMuayeneDetay sonuc) {
if (sonuc != null) {
setHstMuayeneDetay(sonuc);
progressbar.setVisibility(View.GONE);
ImajFayda.drawableRenkDegistir(drawable, R.color.yesil_anamnez);
ivKayitDurum.setImageDrawable(drawable);
ivKayitDurum.setVisibility(View.VISIBLE);
etMuayeneAlan.setError(null);
setKaydedildi(true);
}
}

@Override
public void hata(String hataMesaji) {
super.hata(hataMesaji);
progressbar.setVisibility(View.GONE);
etMuayeneAlan.setError(hataMesaji);
ImajFayda.drawableRenkDegistir(drawable, R.color.kirmizi_bildirim);
ivKayitDurum.setImageDrawable(drawable);
ivKayitDurum.setVisibility(View.VISIBLE);
setKaydedildi(false);

// TODO hata durumunda kullanıcıya showcase gösterilebilir (kirmizi iconu clickle)
// ExtShowcase.showcaseGoster("anamnez_item_showcase1", "Muayene Alanı Kaydedilirken Hata Oluştu.",
// "Herhangi bir hata durumunda hata ikonu ile tekrar deneyebilirsiniz",
// new ViewTarget(ivKayitDurum));

}
});
String cevrilen= JacksonFactory.toJsonString(getHstMuayeneDetay());
try {
new StudyServis().calismalariGetir(cevrilen, null, null, null, null, null, new RetrofitCallback<List<Study>>() {
@Override
public void load(List<Study> studyList) {
if (studyList != null && studyList.size() > 0) {
System.out.println("liststd" + studyList);
Bundle bundle = new Bundle();
bundle.putString("calismalari", JacksonFactory.toJsonString(studyList));
EkranFayda.ac(PacsBildirimCalismaListActivity.class, bundle);

} else {
EkranFayda.toastGoster("Bu kişiye ait çalışma bulunamadı");
}
}
});
} catch (Exception e) {

}
}
}).start();



}
}

public RelativeLayout getAnamnezItemView() {
return anamnezItemView;
}

public boolean isAlanGuncellendi() {
if (hstMuayeneDetay.getTText() == null) {
return !TextUtils.isEmpty(etMuayeneAlan.getText().toString().trim()) && !isKaydedildi();
} else {
return !etMuayeneAlan.getText().toString().trim().equals(hstMuayeneDetay.getTText().trim()) || !isKaydedildi();
}
}


public HstMuayeneDetay getHstMuayeneDetay() {
return hstMuayeneDetay;
}

public void setHstMuayeneDetay(HstMuayeneDetay hstMuayeneDetay) {
this.hstMuayeneDetay = hstMuayeneDetay;
}

public HstMuayene getHstMuayene() {
return hstMuayene;
}

public void setHstMuayene(HstMuayene hstMuayene) {
this.hstMuayene = hstMuayene;
}

public HstBasvuru getHstBasvuru() {
return hstBasvuru;
}

public void setHstBasvuru(HstBasvuru hstBasvuru) {
this.hstBasvuru = hstBasvuru;
}


public String getSeciliGruplar() {
return seciliGruplar;
}

public void setSeciliGruplar(String seciliGruplar) {
this.seciliGruplar = seciliGruplar;
}

public String getYazilanMetin() {
return etMuayeneAlan.getText().toString().trim();
}


public boolean isKaydedildi() {
return isKaydedildi;
}

public void setKaydedildi(boolean kaydedildi) {
isKaydedildi = kaydedildi;
if (drawable != null && ivKayitDurum != null && kaydedildi) {
ImajFayda.drawableRenkDegistir(drawable, R.color.yesil_bildirim);
ivKayitDurum.setImageDrawable(drawable);
ivKayitDurum.setVisibility(View.VISIBLE);
}
}


}


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.