<commit_before>package test.com.smict.person;

import org.junit.Assert;
import org.junit.Test;
import org.joda.time.*;

public class TestGeneratePatID {

	private int thisYear = DateTime.now().getYear();
	private int yearFormat, yearBE;
	
	public String parseYear(int year){
		return String.valueOf(year).substring(
			2, 
			String.valueOf(year).length()
		);
	}

	@Test
	public void testParseYear(){<commit_msg>- Add generate patient id by clinic branch.<commit_after>package test.com.smict.person;

import org.junit.Assert;
import org.junit.Test;
import org.joda.time.*;

public class TestGeneratePatID {
	
	private int thisYear = DateTime.now().getYear();
	private int yearFormat, yearBE;
	private int nextNumber = 10, branchCode = 847;
	private String expectID = "847-60-0000010", resultID;
	
	@Test
	public void testGenerateBranchID(){
		/**
		 * GET YEAR AND CONVERT INTO RIGHT FORMAT
		 */
		this.yearBE = parseToBE(this.thisYear);
		this.yearFormat = Integer.parseInt(parseYear(this.yearBE));
//		Assert.assertEquals(60, yearFormat);		
		
		/**
		 * - FETCH NEXT NUMBER AND CONVERT INTO RIGHT FORMAT 0000003.
		 * - INCREMENT AND RETURN IT.
		 */
		resultID = String.valueOf(nextNumber);
		for(;resultID.length()<7;){
			resultID = "0" + resultID;
		}
		resultID = this.branchCode + "-" + this.yearFormat + "-" + resultID;
		System.out.println(resultID);
		Assert.assertEquals(this.expectID, resultID);
		
	}
	
	public String parseYear(int year){
		return String.valueOf(year).substring(
			2, 
			String.valueOf(year).length()
		);
	}

	@Test
	public void testParseYear(){
{'fraction_non_alphanumeric': 0.12895069532237674, 'fraction_numerical': 0.018963337547408345, 'mean_word_length': 3.946875, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2650350', 'n_tokens_mistral': 587, 'n_tokens_neox': 512, 'n_words': 122}