Android Open Source - SNISI-droid Nutrition Inputs Report Data






From Project

Back to project page SNISI-droid.

License

The source code is released under:

Apache License

If you think the Android project SNISI-droid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.yeleman.nutrition;
//from   w  w w .ja  v a 2s.  c  o m
import com.yeleman.snisidroid.Constants;

import android.util.Log;
import com.orm.dsl.Ignore;
import com.yeleman.snisidroid.ReportData;

public class NutritionInputsReportData extends ReportData {

    @Ignore
    private final static String TAG = Constants.getLogTag(
            NutritionInputsReportData.class.getSimpleName());
        
        // Plumpy Nut
        int plumpy_nut_initial = -1;
        int plumpy_nut_received = -1;
        int plumpy_nut_used = -1;
        int plumpy_nut_lost = -1;
        // Milk_F75
        int milk_f75_initial = -1;
        int milk_f75_received = -1;
        int milk_f75_used = -1;
        int milk_f75_lost = -1;
        // Milk_F100
        int milk_f100_initial = -1;
        int milk_f100_received = -1;
        int milk_f100_used = -1;
        int milk_f100_lost = -1;

        // Resomal
        int resomal_initial = -1;
        int resomal_received = -1;
        int resomal_used = -1;
        int resomal_lost = -1;
        // Plumpy_Sup
        int plumpy_sup_initial = -1;
        int plumpy_sup_received = -1;
        int plumpy_sup_used = -1;
        int plumpy_sup_lost = -1;
        // Supercereal
        float supercereal_initial = -1;
        float supercereal_received = -1;
        float supercereal_used = -1;
        float supercereal_lost = -1;
        // Supercereal_Plus
        int supercereal_plus_initial = -1;
        int supercereal_plus_received = -1;
        int supercereal_plus_used = -1;
        int supercereal_plus_lost = -1;
        // Oil
        int oil_initial = -1;
        int oil_received = -1;
        int oil_used = -1;
        int oil_lost = -1;
        // Amoxycilline 125mg Vials
        int amoxycilline_125_vials_initial = -1;
        int amoxycilline_125_vials_received = -1;
        int amoxycilline_125_vials_used = -1;
        int amoxycilline_125_vials_lost = -1;
        // Amoxycilline 250mg Caps
        int amoxycilline_250_caps_initial = -1;
        int amoxycilline_250_caps_received = -1;
        int amoxycilline_250_caps_used = -1;
        int amoxycilline_250_caps_lost = -1;
        // Albendazole 400mg
        int albendazole_400_initial = -1;
        int albendazole_400_received = -1;
        int albendazole_400_used = -1;
        int albendazole_400_lost = -1;
        // VitA 100K UI Injectable
        int vita_100_injectable_initial = -1;
        int vita_100_injectable_received = -1;
        int vita_100_injectable_used = -1;
        int vita_100_injectable_lost = -1;
        // VitA 200K UI Injectable
        int vita_200_injectable_initial = -1;
        int vita_200_injectable_received = -1;
        int vita_200_injectable_used = -1;
        int vita_200_injectable_lost = -1;
        // Iron_Folic_Acid
        int iron_folic_acid_initial = -1;
        int iron_folic_acid_received = -1;
        int iron_folic_acid_used = -1;
        int iron_folic_acid_lost = -1;
        boolean input_is_complete = false;


    public NutritionInputsReportData() {}

    public static NutritionInputsReportData get() {
        NutritionInputsReportData report = getUniqueRecord(NutritionInputsReportData.class);
        if (report == null) {
            Log.d(TAG, "No Record in DB. Creating.");
            report = new NutritionInputsReportData();
            report.safeSave();
        } else {
            Log.d(TAG, "Record exist in Database.");
        }
        return report;
    }

    @Override
    protected String buildName() {
        return "Situation Stocks";
    }

    protected Boolean isComplete(){
        return input_is_complete;
    }

    protected Boolean atLeastOneIsComplete(){
        return input_is_complete;
    }
    
    protected void resetReportData() {
        NutritionInputsReportData report = NutritionInputsReportData.get();
        report.input_is_complete = false;
        report.safeSave();
    }

    public String buildSMSText() {
        return Constants.stringFromReport(plumpy_nut_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(plumpy_nut_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(plumpy_nut_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(plumpy_nut_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f75_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f75_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f75_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f75_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f100_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f100_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f100_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(milk_f100_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(resomal_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(resomal_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(resomal_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(resomal_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(plumpy_sup_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(plumpy_sup_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(plumpy_sup_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(plumpy_sup_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_plus_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_plus_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_plus_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(supercereal_plus_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(oil_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(oil_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(oil_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(oil_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_125_vials_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_125_vials_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_125_vials_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_125_vials_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_250_caps_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_250_caps_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_250_caps_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(amoxycilline_250_caps_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(albendazole_400_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(albendazole_400_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(albendazole_400_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(albendazole_400_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_100_injectable_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_100_injectable_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_100_injectable_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_100_injectable_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_200_injectable_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_200_injectable_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_200_injectable_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(vita_200_injectable_lost) + Constants.SUB_SPACER +
               Constants.stringFromReport(iron_folic_acid_initial) + Constants.SUB_SPACER +
               Constants.stringFromReport(iron_folic_acid_received) + Constants.SUB_SPACER +
               Constants.stringFromReport(iron_folic_acid_used) + Constants.SUB_SPACER +
               Constants.stringFromReport(iron_folic_acid_lost);
    }
}




Java Source Code List

com.yeleman.nutrition.NutritionHome.java
com.yeleman.nutrition.NutritionInputsReportData.java
com.yeleman.nutrition.NutritionInputsReport.java
com.yeleman.nutrition.NutritionMonthlyHome.java
com.yeleman.nutrition.NutritionMonthlyReportData.java
com.yeleman.nutrition.NutritionSummaryReport.java
com.yeleman.nutrition.NutritionURENAMExsamReport.java
com.yeleman.nutrition.NutritionURENAMO59Report.java
com.yeleman.nutrition.NutritionURENAMPWReport.java
com.yeleman.nutrition.NutritionURENAMReportData.java
com.yeleman.nutrition.NutritionURENAMReport.java
com.yeleman.nutrition.NutritionURENAMU23O6Report.java
com.yeleman.nutrition.NutritionURENAMU59O23Report.java
com.yeleman.nutrition.NutritionURENASO59Report.java
com.yeleman.nutrition.NutritionURENASReportData.java
com.yeleman.nutrition.NutritionURENASReport.java
com.yeleman.nutrition.NutritionURENASU59O6Report.java
com.yeleman.nutrition.NutritionURENFormIface.java
com.yeleman.nutrition.NutritionURENForm.java
com.yeleman.nutrition.NutritionURENIO59Report.java
com.yeleman.nutrition.NutritionURENIReportData.java
com.yeleman.nutrition.NutritionURENIReport.java
com.yeleman.nutrition.NutritionURENIU59O6Report.java
com.yeleman.nutrition.NutritionURENIU6Report.java
com.yeleman.nutrition.NutritionWeeklyReportData.java
com.yeleman.nutrition.NutritionWeeklyReport.java
com.yeleman.projetsnisi.ApplicationTest.java
com.yeleman.smir.Constants.java
com.yeleman.smir.CustomOnItemSelectedListener.java
com.yeleman.smir.SMIRAlert.java
com.yeleman.smir.SMIRHome.java
com.yeleman.smir.SharedChecks.java
com.yeleman.snisidroid.ChangePassword.java
com.yeleman.snisidroid.CheckedFormActivity.java
com.yeleman.snisidroid.Constants.java
com.yeleman.snisidroid.Popups.java
com.yeleman.snisidroid.Preferences.java
com.yeleman.snisidroid.ReportData.java
com.yeleman.snisidroid.SMSDeliveredReceiver.java
com.yeleman.snisidroid.SMSReceiver.java
com.yeleman.snisidroid.SMSSentReceiver.java
com.yeleman.snisidroid.SMSUpdater.java
com.yeleman.snisidroid.SNISIAbout.java
com.yeleman.snisidroid.SNISIApp.java
com.yeleman.snisidroid.SNISIHome.java
com.yeleman.snisidroid.SharedChecks.java